On 11/12/03 12:39 AM, "David Abrahams"
Jon Kalb
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"
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 Kalb@LibertySoft.com