The GC and performance, but not what you expect
Marco Leise via Digitalmars-d
digitalmars-d at puremagic.com
Fri May 30 02:51:15 PDT 2014
Am Fri, 30 May 2014 10:29:58 +0200
schrieb Rainer Schuetze <r.sagitario at 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.digitalmars-d@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
More information about the Digitalmars-d
mailing list