* [PATCH 1/2] xap_helper_cxx: -O2 optimize read-only files by default
2024-02-12 21:28 5% [PATCH 0/2] xap_helper C++ fixes Eric Wong
@ 2024-02-12 21:28 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2024-02-12 21:28 UTC (permalink / raw)
To: meta
While fast build times from -O0 is critical to my sanity when
actively working on C++, the files installed via package
managers or `make install' aren't likely to change frequently.
In that case, expensive -O2 optimizations make sense since the
10-20s saved from a single large --join more than covers the
cost of waiting on g++ to optimize.
---
lib/PublicInbox/XapHelperCxx.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/PublicInbox/XapHelperCxx.pm b/lib/PublicInbox/XapHelperCxx.pm
index 6bd165b8..eafe61a8 100644
--- a/lib/PublicInbox/XapHelperCxx.pm
+++ b/lib/PublicInbox/XapHelperCxx.pm
@@ -30,6 +30,7 @@ my $xflags = ($ENV{CXXFLAGS} // '-Wall -ggdb3 -pipe') . ' ' .
' -DXH_SPEC="'.join('',
map { s/=.*/:/; $_ } @PublicInbox::Search::XH_SPEC) . '" ' .
($ENV{LDFLAGS} // $ldflags);
+substr($xflags, 0, 0, '-O2 ') if !defined($ENV{CXXFLAGS}) && !-w __FILE__;
my $xap_modversion;
sub xap_cfg (@) {
^ permalink raw reply related [relevance 7%]
* [PATCH 0/2] xap_helper C++ fixes
@ 2024-02-12 21:28 5% Eric Wong
2024-02-12 21:28 7% ` [PATCH 1/2] xap_helper_cxx: -O2 optimize read-only files by default Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2024-02-12 21:28 UTC (permalink / raw)
To: meta
I suppose -O2 build times isn't the worst thing for release
users even though I can't stand it while hacking...
Eric Wong (2):
xap_helper_cxx: -O2 optimize read-only files by default
codesearch: generate_cxx: drop unused variables
lib/PublicInbox/CodeSearch.pm | 1 -
lib/PublicInbox/XapHelperCxx.pm | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2024-02-12 21:28 5% [PATCH 0/2] xap_helper C++ fixes Eric Wong
2024-02-12 21:28 7% ` [PATCH 1/2] xap_helper_cxx: -O2 optimize read-only files by default Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).