GCCollect timings.

BlitzMax Forums/BlitzMax Programming/GCCollect timings.

tonyg(Posted 2007) [#1]
I'm not entirely sure what I am showing here but I got the following results with this code :
Normal GC (comment GCSetMode and GCCollects)
447 633 12088
No GC (uncomment GCSetmode 2, comment GCCollects)
666 1528 6413162
Manual GC (uncomment GCSetmode 2 and GCCollects)
665 235 3212106
Normal GC plus manual collects (comment GCSetmode, Uncomment gccollect)
336 264 12024
I don't think the actual test run is important other than to check timings.


The results suggest
- No GC is terrible.... duh!!!
- GC is OK
- Manual GC is better
- Auto plus user decided GCollects() is best.
.
I *did* think of some complicated system of manual GC where I turned off auto-GC and checked some available mem, last run algo and scheduled GCCollect during a quiet time (between levels, player dies etc).
However, for now, what do you make of the results?<edit> P.S. I realise the GCCollect is outside the timing code but it's to show what happens if you decide where to run it.
<edit2> Interestingly, putting the gccollect in the second time-set makes a shorter total-time than auto-GC than putting it in the first. I guess it will do additional things to Auto-GC in the first test.
<edit3> I think what I am saying is, much like we put a flushmem into a heavy function, it might be worth scheduling your own GCCollects in strategic places... or do you all do that already?


Dreamora(Posted 2007) [#2]
did you try with Mode -1 as well?
According the module sources this is the aggressive mode ^^


Grisu(Posted 2007) [#3]
Aggressive? Could you be a bit more specific?


Perturbatio(Posted 2007) [#4]
Aggressive? Could you be a bit more specific?

I *think* (looking at the source) that it will clean as much as it can as quickly as it can, automatic looks like it does it in stages.

It's likely to be inefficient for speed but efficient for memory usage.


tonyg(Posted 2007) [#5]
Yep, I gave it a quick try but it didn't make things any quicker and was slower than the normal GC.


Grisu(Posted 2007) [#6]
Thanks for the explanation. "Seemed" slower for me as well.

It would be great to have a better command
documentation. Am I repeating myself...sorry... *sigh