This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: On inlining in C++

> People are looking at this problem from two different angles:
> a.  What will, on average, give the best performance?
> b.  What will, on average, cause the least trouble?
> Andrew.

Right, those two angles always have to be considered. Note that the decision
in gcc to default to -O0 clearly is more concerned with consideration b than
a. This is probably reasonable, although it often costs gcc in benchmarks
against other compilers where optimization is the default (we have seen
behcnmarking protocols which require the default switches to be used, yes
that's silly, but it happens!)

> "I do not believe that would be a surprise to anyone who thought about
> it for a minute."

You are assuming a model of someone who understands the possible effects
of inlining and knows what an instruction cache is and how it works. The
readership and writership of this list is hardly a representative cross-
section of "in the trenches" C++ programmers, who in my experience have
very little awarness of what is going on at the machine level.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]