Do you use D's GC?

russhy russhy at gmail.com
Mon Aug 2 02:15:19 UTC 2021


> Just to add, from my rough tests it shows that you can have 
> unnoticeable collections for up to 300MB heap size depending on 
> CPU/RAM specs, after that there is clearly perceivable stutter 
> that drags FPS down esp. with loop allocations.
>


16ms per frame at 60FPS, anything above will introduce frame 
stutters

Even if it's one every minutes, user will notice, games need 
predictable performance, you don't want to miss a combo because 
your GC decided to collect this frame for up to 3 frames

GC is not an issue if you manually manage it GC.disable() then 
GC.collect() during loading screen

But if your game never has loading screens, or if they are spaced 
out for way too long, then it's preferable to manage everything 
without it at all

Pool entities, use arena allocators, GC only introduce issues 
that you have to workaround (threading for ex)


More information about the Digitalmars-d mailing list