[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inlining doesn't happen on OS X: big performance problem

From: Daniel Colascione
Subject: Re: Inlining doesn't happen on OS X: big performance problem
Date: Thu, 19 Sep 2013 14:11:49 -0700
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

On 9/19/13 2:04 PM, Andreas Schwab wrote:
> Daniel Colascione <address@hidden> writes:
>> On 9/19/13 9:35 AM, Andreas Schwab wrote:
>>> Daniel Colascione <address@hidden> writes:
>>>> Can we please remove these "!defined __APPLE__" tests and start inlining
>>>> functions again in OS X?
>>> Why doesn't the compiler inline static functions by itself?
>> Why should it?
> There is no reason not to do it.

Sure there is: programs would be huge if compilers naively treated every
"static" as "inline, so they don't. Instead, compilers inline some
static functions, some of the time, and the heuristics they use for
deciding whether to do that are inscrutable and variable. Why should we
rely on these heuristics for good performance when we just write "static
inline" and make the decision ourselves?

If we've identified a bit of inlining as performance critical, there is
every reason to tell the compiler "this is important" instead of just
hoping that the compiler figures it out on its own. We shouldn't strip
these hints from existing code, at least.

>> Why should we remove this hint?
> "Hint" is the essential hint.

What's wrong with leaving hints in the code? We still have "register"
all over the place, and "static inline" does much more than "register".

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]