public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: LIU Hao <lh_mouse@126.com>
To: Licht Martin Werner <martin.licht@epfl.ch>, gcc-help@gcc.gnu.org
Subject: Re: Do definitions in headers still help optimization?
Date: Fri, 12 Jan 2024 22:49:20 +0800	[thread overview]
Message-ID: <d938815e-862c-4fb9-819d-4ccd5573ce60@126.com> (raw)
In-Reply-To: <be3815ac-bb30-4297-bcfe-3873c850378c@epfl.ch>


[-- Attachment #1.1: Type: text/plain, Size: 878 bytes --]

在 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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2024-01-12 14:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 14:07 Licht Martin Werner
2024-01-12 14:49 ` LIU Hao [this message]
2024-01-12 16:01   ` Xi Ruoyao
2024-01-12 17:58     ` LIU Hao
2024-01-14 10:44       ` Xi Ruoyao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d938815e-862c-4fb9-819d-4ccd5573ce60@126.com \
    --to=lh_mouse@126.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=martin.licht@epfl.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).