Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2006-05-11 21:59:30


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. Yet, YMMV; and good
for us, switching data types is easy :) I remember the old days when
there is only one type: cons, then the ensuing debate as to which
data structure is best suitable for a tuple, then I wrote a vectorized
tuple (which became Fusion1), etc... Now, I do not want to go back!!!

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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