> Default memory allocator is a bottleneck for native C++ code, .NET's
> garbage collector does better. But .NET cannot even come close to the
> performance using a well-designed allocator like hoard.
> http://www.hoard.org/
Can you point to any studies that justify that statement? The built-in
allocqator for VC++ is certainly no winner on speed, but for certain
workloads, I'd expect the .NET allocator to beat the best written non-GC
allocator. Likewise, for certain workloads, I'd expect a well written
non-GC allocator to kick the pants off of the .NET allocator. Which is
better depends on your application.
-cd
Ben Voigt [C++ MVP] - 09 Aug 2007 21:26 GMT
>> Default memory allocator is a bottleneck for native C++ code, .NET's
>> garbage collector does better. But .NET cannot even come close to the
[quoted text clipped - 7 lines]
> non-GC allocator to kick the pants off of the .NET allocator. Which is
> better depends on your application.
The .NET allocator is still a shared allocator, with all the performance hit
associated with contention. Take a look at the hoard feature list. It
accounts for and tries to automatically improve things I'd never even
considered, like false cache-line sharing. The .NET allocator, though it
benefits from the advantages of GC, simply isn't in the same class.
Probably some gc-based allocator could beat hoard on the workloads you speak
of, but I don't think the .NET one is sophisticated enough to compete.