Re: Do definitions in headers still help optimization?

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

 



在 2024/1/12 22:07, Licht Martin Werner via Gcc-help 写道:
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.

I'm still having a project which usually compiles and links in two minutes, but with LTO would take hours to link. I can give a link if you are interested.

I'd like to say that LTO is still not an option for me.


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


[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