3 ms·
Are GC pauses really significant? I can understand there being problems if you have to churn through gigabytes of world data, but the author's games don't appea
by weavejester 11y ago
Are GC pauses really significant? I can understand there being problems if you have to churn through gigabytes of world data, but the author's games don't appear to be on that scale.
- Narishma 11y agoTheir unpredictablity is a bigger concern than their duration when it comes to games.
- 0xcde4c3db 11y agoThey often are if specific care is not taken to minimize garbage in the game loop, particularly in resource-constrained environments like some console and mobile platforms [1]. In GC languages, this often means deliberately avoiding common idioms that perform allocation under the hood. The threshold for a noticeable pause is much lower for action games than it is for general applications. 100ms is often used as a rule-of-thumb "instantaneous reaction" threshold for general UX [2], but that's a lot of time to a highly competitive player (e.g. this guy playing Super Punch-Out blindfolded [3]). In fact, in high-reliability real-time software, even non-GC heap allocation is often avoided (or done once at startup and then left alone). Heap allocation is not a very predictable operation beyond "probably fast enough". [1] https://stackoverflow.com/questions/5063190/game-jitters-on-xbox360 https://stackoverflow.com/questions/5063190/game-jitters-on-... [2] https://www.nngroup.com/articles/response-times-3-important-limits/ https://www.nngroup.com/articles/response-times-3-important-... [3] https://youtu.be/vSr3aXd4XuQ?t=358 https://youtu.be/vSr3aXd4XuQ?t=358
- weavejester 11y agoI can see that you'd probably have to take care on mobile and older platforms, and with resource-heavy games. But I have difficulty imaging that there'd be much issue with anything else, as long as the code wasn't overly terrible. Do you happen to know of any benchmarks, or non-anecdotal evidence?
- davexunit 11y agoLike in any program written in any language, you want to minimize allocation. People love to play the garbage collector blame game.