Boost logo

Boost Users :

From: Jon Kalb (Kalb_at_[hidden])
Date: 2003-11-12 11:50:42

On 11/12/03 12:39 AM, "David Abrahams" <dave_at_[hidden]> wrote:

> Jon Kalb <Kalb_at_[hidden]> writes:
>> I will forward this message to him and ask if he wants to comment more
>> specifically, but I'll give you one example that he found. I don't recall
>> the exact number, but he found that a function call using Boost::function
>> generated about 20K of code (in our development environment). I realize that
>> in a day when gigabyte hard drives are a dime a dozen it seems miserly to
>> worry about 20K, but that is for *one function call*.
> With optimization on?

Apparently not. It isn't so bad in the ship build and the hit is not in the
invocation, but in the construction.

> I find that _very_ hard to swallow, as I have
> some idea what's involved under the hood of Boost.Function. Unless,
> of course, the size was really going into the function object being
> wrapped by Boost.Function... if you're just wrapping (member)
> function pointers Boost.Function should generate very little extra
> code. Can you have your coworker post an example which demonstrates?

He has already posted to this list saying:

On 11/11/03 11:25 AM, "Jorg Brown" <jorg_at_[hidden]> wrote:

> an enormous amount of
> code (660 bytes in an optimized, no-symbols build) is generated when I
> say something as simple as
> void Testbed(void) {
> boost::function<void> SimpleFPtr(&Testbed);
> }

Jon Kalb

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at