Boost logo

Boost :

Subject: Re: [boost] [xint] Third release is ready, requesting preliminary review
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-05-05 13:40:48


Stewart, Robert wrote:
> Steven Watanabe wrote:
>> As far as I am concerned, this has nothing to do with portability
>> as a goal for Boost. We're talking about optimizations that don't
>> affect the observable behavior of any program. The compiler
>> is free to do whatever it darn well pleases, regardless of whether
>> you say inline or not. msvc has supported link time code generation
>> for a while, and gcc now has -flto.
> You've dragged this far afield. The original contention was that functions in a .cpp would be inlined.

And you claimed that they can't be inlined.

> I countered that as not being portable, which is to say that it will only work on select platforms and only when configured to do so.

Like all optimizations.

> The only way to have any chance of inlining for the widest range of platforms and configurations possible is to put the function definitions in a header and mark them inline if they aren't in the class definition. That won't force any compiler to inline them, but that gives the best chance for it. I hardly think that's controversial.

It's more likely that they'll be inlined, sure. But why do you care?
inlining these functions probably won't have much effect on performance.
At most you save one function call and one conditional branch.
If I really care about differences like this, I'm probably going to be
turning on whole program optimization. Further, I highly doubt that we're
going to do the micro-optimizations to make it run as fast as possible
on less widely used compilers, anyway.

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at