Do definitions in headers still help optimization?

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

 



Dear all,

Does keeping definitions of functions in header files still help the compiler optimize your code? Or is that advice outdated?

The answer used to be a certain yes when all optimizations were exclusive to the translation unit. By now, link-time optimization has been a thing for a while, and one might imagine that defining functions in header does not make a difference for optimization anymore.

(Of course, placing functions in header files or asking for link-time optimization will affect the compilation speed and memory use)

Discussions of this question seem to be based on hearsay, so I'd rather hope for an answer straight from the source. Thanks.

Martin





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux