Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-05-15 08:49:57


Joel de Guzman <joel_at_[hidden]> writes:

> David Abrahams wrote:
>> Joel de Guzman <joel_at_[hidden]> writes:
>>
>>> Tobias Schwinger wrote:
>>>> Joel de Guzman wrote:
>>>>> Tobias Schwinger wrote:
>>>>>
>>>> 4. Choice of datastructures
>>>>
>>>> I used cons lists for the tree because I figured they might be limitless and
>>>> because the structure is built one element at a time.
>>>> There will be a lot of traversal later -- does it make a difference / would
>>>> have 'vector' been a better choice?
>>> It's really hard to tell. Only testing and benchmarking will reveal
>>> which to choose. I'm sure you noticed that from the recent Spirit-dev
>>> tests conducted. I too get mild surprises every now and then with the
>>> test results. Anyway, in general, vectors are way faster to traverse
>>> and have the smallest memory (struct) footprints.
>>
>> Seems to me a vector can't do as well as some other structures when
>> many of the elements of the tuple are empty classes.
>
> In terms of memory footprint?

Yes.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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