D on quora ...

Random D user no at email.com
Sat Oct 7 15:12:08 UTC 2017


On Friday, 6 October 2017 at 18:09:58 UTC, Ali wrote:
> On Friday, 6 October 2017 at 17:27:03 UTC, H. S. Teoh wrote:
>> On Fri, Oct 06, 2017 at 05:14:51PM +0000, Rion via 
>> Digitalmars-d wrote:
>>> https://www.quora.com/What-is-your-review-of-D-programming-language
>>> 
>>> It seems that D still has the GC being mentioned up to today.
>>> 
>>> Maybe its better to move the standard library slower to a non 
>>> gc version in the future...
>>
>> Why is GC a problem?
>>
>>
>> T
>
> The reputation is D's GC is slow, and Manual Memory Management 
> is fast

Actually, Manual Memory Management is slow and D's GC is slower.

But IMO that kind of means GC isn't that big of a problem in D. 
Because, if malloc/free is slow (free is often slower), you want 
to avoid them as much as possible. You do this by reusing your 
memory/buffers. Which means that even if they are GC allocated 
buffers, they aren't collected and you are not allocating new 
buffers (often) after initial allocs, so the GC doesn't even run.

There was a good talk in cppcon2016 that gives you an example 
what high perf AAA games do for memory allocation. The presenter 
explains how they reduced memory allocations from 300 000 to 3000 
(https://youtu.be/tD4xRNB0M_Q?t=1200).


More information about the Digitalmars-d mailing list