3 ms·
> We spend a lot of time fighting the garbage collector. Have you considered object pools? Getting objects into an older generation will eliminate their impact
by zamalek 3y ago
> We spend a lot of time fighting the garbage collector.
Have you considered object pools? Getting objects into an older generation will eliminate their impact on regular collections. https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.objectpool.objectpool-1 https://learn.microsoft.com/en-us/dotnet/api/microsoft.exten...
You want to be intentional about how long objects hang about. In C# game dev it starts becoming an architectural concern.
That being said, allocation problems aren't unique to managed languages. You'll definitely see at least one pool somewhere in a large-scale C++ game. It's always costly.