Boost logo

Boost :

From: Cory Nelson (phrosty_at_[hidden])
Date: 2008-06-22 23:26:16


On Sun, Jun 22, 2008 at 11:13 AM, Ion Gaztañaga <igaztanaga_at_[hidden]> wrote:
> Hi,
>
> While developing of Interprocess, I started to think about optimizations for
> STL-like allocators. I even wrote a proposal about some new features for
> standard containers (N2045,
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2045.html) that was
> not received with much interest by the committee.
>
> I refined those improvements for shared memory containers and I measured
> performance benefits when containers take advantage of more advanced
> allocators.
>
> The last few months, I've taken another step forward and I've developed a
> small Boost library based on a modified DLmalloc code. I've developed some
> allocators above the modified DLmalloc and I've measured the performance
> benefits that can be obtained with optimized allocators that offer some new
> features like buffer expansion, burst allocation, etc... Test were performed
> using Interprocess containers, but instead of shared memory allocators, I've
> compared DLmalloc based heap allocators against the standard
> std::allocator<>.
>
> I've written a long article with my explanations and conclusions:
>
> http://www.drivehq.com/web/igaztanaga/allocplus/
>
> The library (includes the article) can be downloaded here:
>
> http://www.drivehq.com/web/igaztanaga/allocplus.zip
>
> The library has no docs (the article explains all the basics) and does not
> surely meet Boost standards. The only goal of this article, the library and
> this post is to share information with other Boost container authors and
> discuss possible improvements that maybe could be applied to Boost
> containers. If those improvements are considered interesting, it would be
> great if we could write a library with allocators and develop some "existing
> practice" with boost containers before writing a future proposal to improve
> allocators.
>
> I plan to publish the article somewhere (supposing someone is crazy enough
> to publish it ;-) ) but first I wanted to share this with boosters to try to
> improve the article/library and know if developers are interested in
> allocator issues. Comments are welcome!

Looks very nice! I have some code that could make good use of this -
I'll be playing around with it for the next few days to see how it
goes.

One thing I'd be interested in is a zero-overhead scoped arena.
Sometimes you just need a read-only collection, and don't want a
pointer to a common arena (the overhead) being stored in all the
dynamically sized objects. I've been using Intrusive for this
purpose, but it doesn't call destructors on its own and there's no
vector that lets you one-time sizing.

--
Cory Nelson

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk