by pjmlp · 6y ago · 0 comments
"It's interesting that many games can afford a constant 10x interpretation overhead for scripts, but not a spikey 1% for garbage collection."
https://twitter.com/timsweeneyepic/status/880607734588211200
https://wiki.unrealengine.com/Garbage_Collection_Overview
Which was it again, the engine chosen by Nintendo, Microsoft and Google as first party to their 3D APIs?
https://developer.nintendo.com/tools
https://docs.microsoft.com/en-us/windows/mixed-reality/unity...
https://stadia.dev/blog/unity-production-ready-support-for-s...
https://developer.android.com/games/develop/build-in-unity
The anti-GC crowd on the games industry, is no different than the ones that fought adoption of C/Modula-2/Pascal over Assembly, and then fought adoption of C++ and Objective-C over C.
Eventually they will suck it up when the major platform owners tell them it is time to move on.
Why is that surprising?
Games are basically about humans predicting things and random spikes prevent that from happening in time sensitive games. Beyond game play implications, I suspect there's also something about jerkiness in movement that bugs human senses.
It's not a very satisfactory answer (and there are likely much better tradeoffs to be made), but given the 10x and 1% comparison (not entirely apples to apples though) the comment sounds a bit more interesting.
Performance-oriented code implies everything is on the stack and/or packed into large arrays, at which point you don't need a GC after all.
As the truism goes, if you require your software to be performant, you must first make Performance a Requirement.
In my mind performance is alway a requirement (and a feature). We just stopped caring a long time ago, because it is easier to think about performance as a hardware or capacity problem, memory as GC problem and so on.
1. https://blog.discordapp.com/why-discord-is-switching-from-go...
That's how I've been thinking about it with Haskell at least (lots of GC knobs, manual performGC hook, compact regions for having long-lived data, good FFI, as high-level as any scripting language you could hope for)