3 ms·
Thanks for the response, and everyone else who contributed. The idea of copying-GC compaction was something I hadn't considered - that's a good point. For a G
by NickPollard 14y ago
Thanks for the response, and everyone else who contributed.
The idea of copying-GC compaction was something I hadn't considered - that's a good point.
For a Game though, I still can't see that being better than a decently tuned manual setup. Not even an expert system; for the android game I'm working on currently it's been quite easy for me to batch up allocations sensibly into regions, fixed-sized pools, and some stack allocators, and I'm far from an expert. A lot can be moved into normal stack allocations (i.e. local buffers or alloca() if necessary) and then you avoid most of the slowdown. My malloc() implementation is pretty naive currently (simple linked list) but it's called so rarely and in such predictable patterns that it's not worth me improving anymore (though there are plenty of ways that I could).
I would be interested to see how well a really good JIT doing escape analysis would perform, I suspect there could be a lot of gains there.