How disruptive is the GC?

Kapps via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 29 22:50:48 PDT 2015


On Wednesday, 29 July 2015 at 17:09:52 UTC, Namespace wrote:
> On Wednesday, 29 July 2015 at 09:25:50 UTC, Snape wrote:
>> I'm in the early stages of building a little game with OpenGL 
>> (in D) and I just want to know the facts about the GC before I 
>> decide to either use it or work around it. Lots of people have 
>> said lots of things about it, but some of that information is 
>> old, so as of today, what effect does the GC have on the 
>> smooth operation of a real-time application? Is it pretty 
>> noticeable with any use of the GC or only if you're 
>> deallocating large chunks at a time?
>
> http://3d.benjamin-thaut.de/?p=20

Note that this was 3 years ago, so there have been GC 
improvements since then. I'm not sure what the results would be 
like today (or what the code is like in terms of needless 
allocations).

That being said, you probably want to avoid the GC as much as 
possible for games. Luckily we have tools like -vgc to help with 
that now (and @nogc, but I still consider this mostly unusable 
thanks largely to exceptions).


More information about the Digitalmars-d-learn mailing list