Andy Dougherty wrote:
2. Garbage collection really slows the program down (I observed factors of 10
difference in speed with and without -G), and I have a vague unsupported
suspicion that the slowdown grows faster than linearly with the allocated
memory.
I remember tracing through a load of this code for about an hour. I was
none the wiser afterwards, but I was trying to work out arenas and
allocation stuff and so on.
Basically, if you run the program without -G and then break it, it will
usually break inside the GC routine. What I do remember is that it was
looping through some kinda memory pool, or arena, or whatever. However,
the thing it was looping through was *huge* (like, from 0 to a six
figure number) and I think it maybe was an n^2 algorithm, which
amplified the effect further.
Recent mentions of a lack of memory pool compaction kinda resonates with
what I analyzed; I always meant to return to look a bit more, but never
had time to dig deeper. I think re-discovering where it's spending so
much time during GC would be a good start, though. And just randomly
breaking into the program did it for me, usually first time.
Jonathan