public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vittorio.romeo at outlook dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107105] New: Consider folding `__and_`, `__or_`, and `__not_` at the front-end level Date: Fri, 30 Sep 2022 19:10:54 +0000 [thread overview] Message-ID: <bug-107105-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107105 Bug ID: 107105 Summary: Consider folding `__and_`, `__or_`, and `__not_` at the front-end level Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- This is another possible compilation speed improvement that came to mind after running ClangBuildAnalyzer on a few open source projects (gzdoom, SFML, some of my own, ...) and noticing results like these: **** Template sets that took longest to instantiate: 35407 ms: std::__and_<$> (20262 times, avg 1 ms) 17745 ms: std::unique_ptr<$> (916 times, avg 19 ms) 14302 ms: std::__uniq_ptr_data<$> (916 times, avg 15 ms) 14153 ms: std::__uniq_ptr_impl<$> (916 times, avg 15 ms) 13537 ms: std::__or_<$> (15100 times, avg 0 ms) 13046 ms: std::basic_string<$> (2248 times, avg 5 ms) 11706 ms: std::_Hashtable<$> (1051 times, avg 11 ms) 10527 ms: std::unordered_map<$> (545 times, avg 19 ms) 10379 ms: std::is_convertible<$> (11737 times, avg 0 ms) It looks like `__and_`, `__or_`, and `__not_` are widely used throughout libstdc++'s implementation, and are used to implement most type traits. I was wondering whether it would be possible and somewhat easy to fold these in the front-end, similarly to what has been done for `std::move` and similar functions. Another option is to use a compiler intrinsic. I have not done any research, but I suppose that if this is possible, reducing the number of instantiations of these small helpers would benefit pretty much every project using libstdc++. Just an idea -- feel free to close this ticket if this is not possible or not worth the effort.
next reply other threads:[~2022-09-30 19:10 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-30 19:10 vittorio.romeo at outlook dot com [this message] 2022-09-30 19:31 ` [Bug c++/107105] " redi at gcc dot gnu.org 2024-04-13 1:30 ` pinskia at gcc dot gnu.org
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=bug-107105-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /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: linkBe 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).