Am 24.10.2011, 03:57 Uhr, schrieb Sean Silva <chisophu...@gmail.com>:
For example, if you look in the LLVM source tree, you'll see that they bend over backwards to avoid heap allocations. For example, in some cases, std::vector causes too much heap traffic so they have SmallVector which preallocates a certain amount of storage *inside* of the object itself in order to avoid heap traffic if the number of elements doesn't exceed some predetermined amount. [...] But the thing is that in D, it is possible to write an easy-to-use vector for which it is a one-liner to switch between GC heap-allocated vector object, by-value vector, preallocated internal vector (like SmallVector), and beyond!
Then write your special vector class. I'm sure you can optimize it more than anything that Phobos could ever offer. My point is that you know exactly what you want for your special use case and something in a standard library should not be biased or deviate too much from the 'book version' of a container. If anything I would support the inclusion of Judy Arrays, or other specialized data structures, that have a name that rings a bell.