5 ms·
> ton of useful stuff (from template metaprogramming to fast matrix algebra), it's loosely coupled, and it's insanely fast It's actually not all that fast in a
by wheels 16y ago
> ton of useful stuff (from template metaprogramming to fast matrix algebra), it's loosely coupled, and it's insanely fast
It's actually not all that fast in a lot of cases. Boost's matrix manipulation support is particularly slow:
http://eigen.tuxfamily.org/index.php?title=Benchmark-August2008 http://eigen.tuxfamily.org/index.php?title=Benchmark-August2...
Also a lot of the template aerobatics generate a ginormous number of symbols which massively increase the binary size and cache pressure. In a former life I ripped out a pile of heavily templated code using Boost and replaced it with a well placed virtual function or three and dramatically reduced the cache misses in the application.
I've always seen Boost (and to a large extent the STL) as a demo library to show off what's possible with templates rather than something to be used in everyday code and have worked on a number of projects which forbade both.
There's a large rift in the C++ world between what I generally label Qt and Boost camps. The Boost people see the Qt folks as Java-esque dimwits that can't be bothered to learn the full extent of C++'s power and the Qt folks see the Boost following as unpragmatic architecture astronauts.
- timr 16y ago"It's actually not all that fast in a lot of cases. Boost's matrix manipulation support is particularly slow" You've picked a benchmark of the most highly optimized matrix algebra libraries, and found that uBLAS is mid-pack, even though a) it isn't particularly optimized for any platform, and b) its goal is to result in the clearest possible syntax without sacrificing adequate performance. Talk about picking nits. "Also a lot of the template aerobatics generate a ginormous number of symbols which massively increase the binary size and cache pressure." When it really matters (which it rarely ever does): man strip "I've always seen Boost (and to a large extent the STL) as a demo library to show off what's possible with templates rather than something to be used in everyday code" I worked on shipping commercial products that used boost and the STL, and I did nearly all of my speed-sensitive code with it in grad school. It's far more than a demo library. Like I said before, you don't have to use all of it to use some of it.
- blub 16y agoFirst of all, please provide recent benchmarks (GCC 4.2 is not recent) on multiple OSes that test more than one small subset of Boost. Otherwise your statements about performance are doubtful at best. Second of all, those symbols will have an effect on compile times, but they should certainly be stripped out by the linker. Why would symbols that do nothing sit in the executable? Thirdly, Boost's purpose is to iterate faster than the C++ standard library and have real-world data about what libraries work and are needed. Those libraries would then be included in next C++ standards, as it has happened with TR1. There are useful libraries inside Boost and there are research libraries or concept libraries. Don't use a library just because it's included in Boost! I use Boost and Qt. Since TR1 I didn't need Boost as much, which means that it's achieved one of its goals.