4 ms·
The other question is: can I at least time this GC so it doesn't overlap the refresh interval and skip a frame? Because 1ms may not be significant if it lands i
by cmrdporcupine 7y ago
The other question is: can I at least time this GC so it doesn't overlap the refresh interval and skip a frame? Because 1ms may not be significant if it lands in the middle of the 16ms period, but if it lands at the end you've just produced jitter.
So I'd think a GC designed for a gaming system would take this into account; incremental concurrent GC that can be timed to happen at the start of each each frame interval and be paused if it gets close to the end.
- corysama 7y agoYou can manually trigger GC in Lua. I’ve used this to trigger light GC work every frame in some games to buy more consistent GC times (no spikes) at the cost of higher average times.
- brighteyes 7y agoChrome does this too, it times GCs for when it has free time or is rendering in another thread, https://blog.chromium.org/2015/12/smarter-garbage-collection-for-smoother.html https://blog.chromium.org/2015/12/smarter-garbage-collection...
- markdog12 7y agoI remember the oddly named System.pauseForGCIfCollectionImminent() AS3 (Flash) function: https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/System.html#pauseForGCIfCollectionImminent() https://help.adobe.com/en_US/FlashPlatform/reference/actions...