Re:New Rust runtime turned on. What next?
by TylerE on Thursday August 08, 2013 @07:36PM
(#6182720)
When latency matters, just use pool allocation, which makes the GC irrelevant.
[ Parent
| on HN ]
That's how people manage to make games despite GC, but I always thought it's a huge hack, having been there. If all you do with your GC is fight it, is it actually a good idea to have it?
One thing that makes me excited about Rust is that GC is optional.
Re:New Rust runtime turned on. What next?
by pcwalton on Thursday August 08, 2013 @07:44PM
(#6182746)
Pools are still traced.
If you pool everything, the GC never runs and tracing is irrelevant. However, getting to there is very difficult. Better is to just make sure you throw almost everything away before the next GC, have a small permanent runtime set of objects and accept 10-20ms stop the world young gen collections.
Targeting 30fps, you have 33ms to render whole frame. Losing 20 ms of that to GC would make things… challenging.
And if you're targeting 60fps, that's 16ms. Stop the world for 20ms, and you've missed 1 and 1/4 of a frame.