Boost logo

Boost :

Subject: Re: [boost] Proposal: Monotonic Containers
From: Christian Schladetsch (christian.schladetsch_at_[hidden])
Date: 2009-06-15 05:01:56


Hi Christopher,

I think you are over-stating the importance of the stack. I just ran your
> experiments with a heap-allocated inline_storage and got very similar
> results.

You are right, and I should have posted results for heap- and stack-based
storage originally.

Belatedly, here are my results for heap-based monotonic storage, VS2008:

size mono std mono/std
3 0.001 0.008 0.12
13 0.027 0.046 0.58
23 0.089 0.119 0.74
33 0.183 0.226 0.80
43 0.31 0.369 0.84
53 0.474 0.555 0.85
63 0.669 0.745 0.89
73 0.912 0.987 0.92
83 1.183 1.269 0.93
93 1.467 1.594 0.92

Compared with my posted results for stack-based storage, VS2008:
3 0.001 0.008 0.12
13 0.027 0.047 0.57
23 0.085 0.119 0.71
33 0.179 0.23 0.77
43 0.305 0.377 0.80
53 0.472 0.552 0.85
63 0.655 0.759 0.86
73 0.883 1.009 0.87
83 1.14 1.295 0.88
93 1.444 1.639 0.88

Putting the data on the stack makes a slight difference. And it can only be
explained by spatial locality on the stack. Not much difference in this
specific case, surely, but ~5% is far better than nothing, especially if it
is free. All this test did was forward iterate over the list. I predict
there would be greater benefit if there was more traffic between elements in
the container and stack-based values.

In any case, the fact that it works almost as well on the heap as on the
stack is a good thing.

I need to isolate out the cost of new and delete, to see what the benefits
are to having a smaller data-structure, if any.

Christian.


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