In that world, uncached has to be treated as the normal case. When you say "no performance impact" you mean no negative performance impact, and that might be technically true (or it might not), but.īut that's not how a hard real-time system is designed. In many domains it's OK to think about caching as a normal case, and to consider cache hit ratio during designs. Caches exist to have a performance impact. I'm not just being snarky there's an important point here. If there were no performance impact, there would be no point. > if these are transparent, no-performance-impact caches We ultimately abandoned that idea for various reasons (though I left over 6 years ago so I have no idea how things are today). We struggled enough that we discussed exposing more direct memory management through a custom JS API so we could more directly control things. That said, there were often fairly large variances in how long it would take and, while frame time budgets may seem to accommodate things, if you end up in a situation where one of your "heavy computation" frames coincides with a GC that runs long, you're going to get a nasty frame time spike. We actually added an API hook in our JS to manually trigger GC (something you can do when you ship a custom JS runtime) so we could take at least the "when it happens" out of the picture. The problem we ran into with garbage collection was that it was generally non-deterministic both in terms of when it would happen and how long it would take. I don't think it's necessarily that it "can't" work as much as it takes away a critical element of control from the game developers and the times you find yourself "at the mercy" of the garbage collector is pretty damn frustrating. I also have no experience in Go so I can't comment on the specifics of that garbage collector vs. I'm -not- suggesting that running a GC on every frame is a good idea or that it should be done, but what I find so deeply frustrating is that the argument that GC can't work in a game engine is never qualified.Įdit: wow for once the replies are actually good, very pleased with this discussion.ĭisclaimer: I'm not a game developer but, I've worked on a lot of projects with tight frame time requirements in my time at Netflix on the TVUI team. If you have a garbage collector that runs in 200us, you could run a GC on every single frame and use less than 3% of your frame budget on the GC pause. What latency budgets are you working with? How often do you do work to free resources? What are the latency requirements there? Even at 144 fps, that's 7ms per frame. ![]() ![]() The reality is you still have to free resources, so it's not like the garbage collector is doing work that doesn't need to be done. They just hand wave and say "GC can't work". I love this opinion from games programmers because they never qualify it and talk about what their latency budgets are and what they do in lieu of a garbage collector. The stop-the-world garbage collection is a big pain for games, stopping the world is something you can't really afford to do.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |