$4*******@news.tdc.fi:
I performed some tests about creating memory allocators. It's actuallyI would guess that most speedup comes from the fact that the general
quite incredible how much, for example, std::list speeds up by using
your own efficient allocator instead of relying on the one in libc.
I actually made a library and a webpage on this subject:
http://warp.povusers.org/FSBAllocator/
allocator is thread-safe and yours is not (according to the web page), so
you are comparing not quite the same things. Thread synchronization is
quite expensive (and becomes relatively more expensive all the time with
the number of processor cores growing). I think in the future one routinely
needs at least three different allocators: multi-threaded, single-threaded
and single-thread-favoured (deallocating a block in another thread works,
albeit being slower; IIRC Intel's TBB library contains some allocators of
the latter sort). Not sure what C++0x has to say about this issue, though
it would deserve attention IMHO.
Regards
Paavo