Am Fri, 30 May 2014 10:29:58 +0200 schrieb Rainer Schuetze <r.sagita...@gmx.de>:
> > > On 29.05.2014 12:09, Atila Neves wrote: > > The GC is preventing me from beating Java, but not because of > > collections. It's the locking it does to allocate instead! I > > don't know about the rest of you but I definitely didn't see that > > one coming. > > > > A lock should not be more than a CAS operation that always succeeds in a > single threaded application, but OS overhead might be considerable. > > Adam Sakareassen has recently announced a rewrite of the GC that has > lock-free allocations: > http://forum.dlang.org/thread/mailman.655.1399956110.2907.digitalmar...@puremagic.com > > Unfortunately, it isn't available yet... I recently tried to write a single-type memory allocator and thought I'd come out faster than TCMalloc due to its simplicity. But as soon as I added a single CAS I was already over the time that TCMalloc needs. That way I learned that CAS is not as cheap as it looks and the fastest allocators work thread local as long as possible. -- Marco