Boost logo

Boost :

Subject: Re: [boost] [Block Pointer] benchmark
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-05-25 08:15:33


On 25/05/2011 00:40, Phil Bouchard wrote:
> Hi,
>
> Just for the records I have benchmarked block_ptr using:
> https://svn.boost.org/svn/boost/sandbox/block_ptr/libs/smart_ptr/example/benchmark.cpp
>
>
> And I get the following:
> auto_ptr: 9208870 ns
> shared_ptr: 22958516 ns
> block_ptr: 75860365 ns
>
> Which is pretty good given the complexity it goes thru.

If you want a really useful benchmark, I'd suggest you give the max and
average cycle count of each primitive associated with those types
(construction, copy constructor, assignment, dereference, destructor)

> I was wondering if there is any hope in having a pool::ordered_malloc()
> call of O(1) instead of O(n)

I don't see how such a thing would be possible, unless you can guarantee
that all your allocations/deallocations happen in a LIFO order (in which
case you can use the non-ordered allocation).

> and a faster pool::is_from()? The latter
> could be just a check to see if a pointer is within reserved memory
> pages of the pool. I tried to talk to the author of pool but I got no
> response.

The pages are not contiguous, so you need to walk through each page at
least.


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