Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-07-28 13:50:16

From: "Andrei Alexandrescu" <andrewalex_at_[hidden]>

> An argument that was aired is that various compile-time structures would
> lead to different compile times. Consequently, the argument goes, the
> developer would select the structure that leads to the least memory
> and the fastest compile time. However, experience shows that various
> compilers prefer various data structures, depending on how the compilers
> implement templates. So if one is to write portable code, there is no
> choice of a structure over another.

Hi Andrei,

Just a few comments:

1. Which experience are you talking about? I ask because previous
measurements of the compilation speed of MPL algorithms on its structures
were misleading. The slowness people were seeing had mostly to do with the
particular way the preprocessor library was used in the implementation (and
a few other factors, I think -- Aleksey can say for sure). In any case,
those issues have been addressed in the implementation under review.

2. It's not just about compilation speed, although that's a real factor
also. There are other compilation resources which count as well, such as
depth of template instantiation. Some compilers have internal limits on how
much nesting they will allow... and this too affects speed on some

3. Data structures offer more than just linear constructions. For example,
given the right iterators we can treat a tree as a sequence. I realize you
can represent a tree using dot typelists, but without iterators you need a
special algorithm to flatten the tree before you can use it in sequence


           David Abrahams * Boost Consulting
dave_at_[hidden] *

Boost list run by bdawes at, gregod at, cpdaniel at, john at