On Fri, 18 Feb 2011 11:35:18 PST David Leimbach <[email protected]> wrote: > >> C++ inlines a lot because microbenchmarks improve, but inline every > >> modest function in a big program and you make the binary much bigger > >> and blow the i-cache. > > > > That's a compiler fault. Surely modern compilers need to be > > cache aware? ideally a smart compiler treats `inline' as a hint > > at most, just like `register'. > > Well how does template expansion affect all of this? I've heard in conversa= > tions that C++ is pretty register hungry which makes me think lots of inlini= > ng happens behind the scenes. Then again that's an implementation detail, e= > xcept maybe for templates.=
Templates encourage inlining. There is at least one template libraries where the bulk of code is implemented in separate .cc files (using void* tricks), used by some embedded products. But IIRC the original STL from sgi was all in .h files and things don't seem to have changed much -- but I avoid them so who knows.
