Boost logo

Boost Users :

Subject: Re: [Boost-users] g++ compilation is slow with Boost's constructs
From: Dave Abrahams (dave_at_[hidden])
Date: 2010-09-07 11:38:44


On Mon, Sep 6, 2010 at 6:23 PM, Ilya Murav'jov <muravev_at_[hidden]> wrote:

> So I began to investigate and found out each invocation of known Boost
> constructs has its non-zero cost. I chose a source file(*), commented
> out all and then incrementally uncommented functions from beginning,
> compiled and measured times. Here is my results (compile time, not run
> time!):
> - BOOST_FOREACH costs 0.1 sec
> - boost::function<> invocation costs 0.05 sec
> - boost::lambda::bind() with placeholders costs 0.1 sec
> - Boost.Range adaptor transformed() costs ~0.1 too
> As you can see, 10 boost::lambda::bind() slow down your compilation for
> whole 1 second!
>
> All that is measured against gcc 4.4, Ubuntu 9.10, with the most light
> options I picked up: "g++ -g -O0 -pipe" (I need -g for debugging
> anyway). Also I found out that gcc 4.2 is the quickest from 4.1, 4.2,
> 4.3, 4.4 version of gcc, and gcc 4.4 is the most slow one of them (~28%
> slower than gcc 4.2). :(
>

G++4.5 implements O(1) template lookup, which could have a significant
effect for Boost users.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net