8 ms·
On slide 57 he takes the following position: Memory model – Garbage collection should be the only option an interesting position to see Sweeney take u
by zemo 5y ago
On slide 57 he takes the following position:
Memory model
– Garbage collection should be the only option
an interesting position to see Sweeney take up, since so many people in games reflexively say that garbage collection is totally non-viable whenever it comes up.
but he also says:
By 2009, game developers will face...
CPU’s with:
–20+ cores
MacBook Pros, Razer Blades, the XBox Series X, and the PS5 all use 8-core CPUs, so the prediction of an ever-escalating number of CPU cores seems to have not really panned out. One thing that has been majorly outside of these predictions is the dedicated ML chips like the M1's Neural Engine.
The presentation isn't explicitly dated, but since the sample game is Gears of War, which came out in 2006, later on he says "by 2009" as if it was not-yet 2009, and the file name is "sweeney06games.pdf", gonna say this is almost certainly a presentation given in 2006. At the time this was given, the iPhone hadn't even come out yet.
It's an interesting presentation. I wonder what Sweeney would say today about this presentation, about how much of it still rings true, and about which things he would second-guess nowadays.
- ksec 5y agoYou have to look at it from 2005 context. PS3 was just announced, Cell Processor with 8 CPU Core. But the original target for Cell was 32 Core. It was always thought some day, may be PS4 would get to that. Intel would have to compete with more Cores because they just went through the whole Pentium 4 scaling problem. The future is going to be super multiCore. And software will catch up ( somehow ) once the hardware is here. And that is not exactly a bad take in 2005/2006 considering Intel announced their work on Larabee in 2008 and was pushing for some collaboration with Sony on using it for PS4. And of course none of these happened. GPU and CPU did not converged, they both scale far ahead than anyone could imagined. I mean, if you ask developers in 2006, no one would thought of doing 4K rendering with HDR / 120fps and still not doing Ray Tracing.
- eecc 5y ago> MacBook Pros, Razer Blades, the XBox Series X, and the PS5 all use 8-core CPUs, so the prediction of an ever-escalating number of CPU cores seems to have not really panned out. You seem to forget the GPU, how may cores does that have? (but really the question is: isn't parallelism the default mode when working with GPUs.
- caslon 5y agoGPUs have existed since long before 2009. Sorry, but the guy who wrote Unreal Tournament of all people definitely did not make a basic mistake or generalization like you're insinuating.
- a_lost_needle 5y agoWell, the RTX 3090 apparently has 10496... But I'm not aware of how to use them to optimize garbage collection.
- LegitShady 5y agohe was off by some decades but that is mostly intel's fault. about a decade later we have intel chips coming out with 10 cores and amd with 16 cores. We're getting there.
- pjmlp 5y agoMost of those people aren't aware that Unreal Blueprints and Unreal C++ do have GC. They just see C++ and don't look into the details. Besides that, given that most engines now have a scripting layer, even if deep down on the engine GC is forbidden, the layer above it, used by the game designers, will make use of it. It is like fostering about C and C++ performance, while forgetting that 30 years ago, they weren't welcomed on game consoles, and on the 8/16 bit home micros for games. My phone is more powerful than any Lisp Machine or Xerox PARC workstation, it can spare some GC cycles.
- lelanthran 5y ago> My phone is more powerful than any Lisp Machine or Xerox PARC workstation, it can spare some GC cycles. Speak for yourself; most phones I see still take 2+ seconds to open some apps. As far as desktop goes, even fewer cycles can apparently be spared - IntelliJ frequently freezes for 5s just after startup, most applications have insane startup times considering the power they have. So, no, I don't want to add yet another slowdown because "our machines are 1000x faster than high-end digital workstations from 30 years ago", because it seems to me that all off the increases in hardware power have already been used up, and more.
- DrBazza 5y ago> Speak for yourself; most phones I see still take 2+ seconds to open some apps. Why is that though? I've written code since the 8 bit days of BBC micros and ZX Spectrums. Casey Muratori's (who has been on here a lot lately) talk nails it [1] - developers just don't realise how fast their code could and should run. And the fact that we have layers upon layers of frameworks and no one cares. [1] https://www.youtube.com/watch?v=Ge3aKEmZcqY&t=8638s https://www.youtube.com/watch?v=Ge3aKEmZcqY&t=8638s
- pjmlp 5y agoHow long does Photoshop take up to start? The problem isn't the hardware or the language, rather how many stuff gets programmed in an age where plenty of people run for Electron apps and don't care about algorithms and data structures. My first applications had 64KB and 3.5 MHZ at their disposal to make their users happy.
- chc4 5y agoMost people's mental model of garbage collection is still just stop-the-world mark-and-sweep, which is extremely old. Game developers hate GC because of impossible to predict or the lack of ability to limit latency pauses eating into the frame budget - but there are tons of new, modern GC implementations that have no pauses, do collection and scanning incrementally on a seperate thread, have extremely low overhead for write barriers and only have to scan a minimal subset of changed objects to recompute liveness, etc. that are probably a great choice for a new programming language for a game engine. Game data models are famously highly interconnected and have non-trivial ownership, and games already use things like deferred freeing of objects (via area allocators) to avoid doing memory management on the hot path that it could do automatically for everything.
- franknine 5y agoPart of it is also due to Unity3D sticked with the ancient stop-the-world mono GC for a very long time and discuraging developers from doing allocation in official talks.
- DrBazza 5y agoFlipping this, in the C++ world, "garbage collection", is more than just freeing unused references. "Resource release is destruction" Try-with-resources is ok, but not great. Ultimately developers, especially those concerned with performance, prefer full control. And that means deterministic lifetime of memory and resources.
- rcxdude 5y agoAnother big cost of garbage collection is memory usage: it's not uncommon for a high-performance GC to require 2x-3x the memory for the same application compared to non-GC. For games this is not trivial given how heavy some of the assets are.
- hn_throwaway_99 5y agoAfter being both a Java programmer for the greater part of a decade, then spending a bunch of years doing Objective C/Swift programming, I don't really understand why the Automatic Reference Counting approach hasn't won out over all others. In my opinion it's basically the best of all possible worlds: 1. Completely deterministic, so no worrying about pauses or endlessly tweaking GC settings. 2. Manual ref counting is a pain, but again ARC basically makes all that tedious and error prone bookkeeping go away. As a developer I felt like I had to think about memory management in Obj C about as much as I did for garbage collected languages, namely very little. 3. True, you need to worry about stuff like ref cycles, but in my experience I had to worry about potential memory leaks in Obj C about the same as I did in Java. I.e. I've seen Java programs crash with OOMs because weak references weren't used when they were needed, and I've seen similar in Obj C.
- throwawayapples 5y ago> By 2009, game developers will face... CPU’s with: 20+ cores It seems like he was off by a matter of a few months at most. I have a quad AMD Opteron(tm) Processor 6172 (Mar 2010) 2U server with 48 hardware cores. This motherboard can also take the 16 core CPU's which were also introduced the following year, which would put it at 64 cores and 128 threads. The Opteron 6 core CPU's were introduced in June 2009, so a quad server would be 24 cores, or 48 threads. Of course, that's not cores in a single CPU, if that's what even what the prediction was referring to, but that probably wouldn't matter very much from a gaming dev perspective anyway. It was probably a pretty good guess, all things considered.
- Hendrikto 5y ago> a quad server would be 24 cores That‘s not usually what people game on, though. Even today, 20 core CPUs are the exception for gaming rigs.
- throwawayapples 5y agoPoint taken, but it is for server-side games like Fortnite, because the bulk of the game world actually runs on the server. However, I'm not sure when they started shifting over to that model (or even if that's what he was talking about as the future).
- chii 5y ago16 core machines isn't that uncommon today, but i guess back in 2009, it was way less common. But i think the trend is clear - more cores is the future as clock speed has slowed down.
- suyjuris 5y ago> 16 core machines isn't that uncommon today ~0.31% according to the Steam hardware survey [1] If you are including 8-core machines with simultaneous multithreading (so 16 logical cores, 8 physical), then you would be at ~17%, however. [1] https://store.steampowered.com/hwsurvey/cpus/ https://store.steampowered.com/hwsurvey/cpus/
- nabla9 5y agoEven with garbage collection, you still can manage memory manually on top of gc by creating a pool and managing it manually.
- bazooka_penguin 5y agoPretty sure unreal engine 4 and 5 have garbage collection built into the runtime
- deleted 5y ago[deleted]