Linus with some good observations on garbage collection

bearophile bearophileHUGS at lycos.com
Sat Apr 23 10:38:32 PDT 2011


dsimcha:

> It's slightly slower than VLAs, 
> but the difference is negligible since it's still almost never a 
> threading bottleneck and you still have to do something with the array 
> you allocated.

I have to compare the performance of both for my use cases (fast allocations of very small arrays, even a just a small number of chars).
I think an advantage of stack allocations is that most times the top of the current stack is already in cache L1, so it's warm memory.

Bye,
bearophile


More information about the Digitalmars-d mailing list