* [PATCH 0/2] xap_helper C++ fixes
@ 2024-02-12 21:28 Eric Wong
2024-02-12 21:28 ` [PATCH 1/2] xap_helper_cxx: -O2 optimize read-only files by default Eric Wong
2024-02-12 21:28 ` [PATCH 2/2] codesearch: generate_cxx: drop unused variables Eric Wong
0 siblings, 2 replies; 3+ messages in thread
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 [flat|nested] 3+ messages in thread
* [PATCH 1/2] xap_helper_cxx: -O2 optimize read-only files by default
2024-02-12 21:28 [PATCH 0/2] xap_helper C++ fixes Eric Wong
@ 2024-02-12 21:28 ` Eric Wong
2024-02-12 21:28 ` [PATCH 2/2] codesearch: generate_cxx: drop unused variables Eric Wong
1 sibling, 0 replies; 3+ messages in thread
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 [flat|nested] 3+ messages in thread
* [PATCH 2/2] codesearch: generate_cxx: drop unused variables
2024-02-12 21:28 [PATCH 0/2] xap_helper C++ fixes Eric Wong
2024-02-12 21:28 ` [PATCH 1/2] xap_helper_cxx: -O2 optimize read-only files by default Eric Wong
@ 2024-02-12 21:28 ` Eric Wong
1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2024-02-12 21:28 UTC (permalink / raw)
To: meta
We are just using the odd ref+deref (`${\...}') syntax and
don't need to calculate line numbers ourselves, nowadays.
---
lib/PublicInbox/CodeSearch.pm | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/PublicInbox/CodeSearch.pm b/lib/PublicInbox/CodeSearch.pm
index 48697cdc..1f95a726 100644
--- a/lib/PublicInbox/CodeSearch.pm
+++ b/lib/PublicInbox/CodeSearch.pm
@@ -101,7 +101,6 @@ sub qparse_new ($) {
}
sub generate_cxx () { # generates snippet for xap_helper.h
- my ($line, $file) = (__LINE__ + 2, __FILE__);
my $ret = <<EOM;
# line ${\__LINE__} "${\__FILE__}"
static NRP *code_nrp[${\scalar(@CODE_VMAP)}];
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-12 21:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-12 21:28 [PATCH 0/2] xap_helper C++ fixes Eric Wong
2024-02-12 21:28 ` [PATCH 1/2] xap_helper_cxx: -O2 optimize read-only files by default Eric Wong
2024-02-12 21:28 ` [PATCH 2/2] codesearch: generate_cxx: drop unused variables Eric Wong
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).