* [PATCH 7/7] git: avoid Perl5 internal scratchpad target cache
2021-10-24 0:20 6% [PATCH 0/7] misc tweaks and fixes Eric Wong
@ 2021-10-24 0:20 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-10-24 0:20 UTC (permalink / raw)
To: meta
Creating a scalar ref directly off substr() seemed to be causing
the underlying non-ref scalar to end up in Perl's scratchpad.
Assign the substr result to a local variable seems sufficient to
prevent multi-megabyte SVs from lingering indefinitely when a
read-only daemon serves rare, oversized blobs.
---
lib/PublicInbox/Git.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index e634ca55..9d2c5f75 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -158,7 +158,8 @@ sub my_read ($$$) {
return; # unrecoverable error
}
}
- \substr($$rbuf, 0, $len, '');
+ my $no_pad = substr($$rbuf, 0, $len, '');
+ \$no_pad;
}
sub my_readline ($$) {
^ permalink raw reply related [relevance 7%]
* [PATCH 0/7] misc tweaks and fixes
@ 2021-10-24 0:20 6% Eric Wong
2021-10-24 0:20 7% ` [PATCH 7/7] git: avoid Perl5 internal scratchpad target cache Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-10-24 0:20 UTC (permalink / raw)
To: meta
Patch 2 helps lei users avoid wasting bandwidth.
I've been running patches 6 and 7 on https://yhbt.net/lore/
for a while, now; and memory use seems far lower.
The rest are pretty minor things, I think.
Eric Wong (7):
lei: always pass $lei to LeiAuth->op_merge
lei export-kw: skip read-only IMAP folders
shared_kv: remove cache_size attribute support
http: use a larger buffer for ->getline responses
listener: emit warnings on EPERM
thread: avoid Perl5 internal scratchpad target cache
git: avoid Perl5 internal scratchpad target cache
lib/PublicInbox/Git.pm | 3 ++-
lib/PublicInbox/HTTP.pm | 2 +-
lib/PublicInbox/LeiExportKw.pm | 14 ++++++++++++--
lib/PublicInbox/LeiForgetSearch.pm | 2 +-
lib/PublicInbox/LeiImport.pm | 2 +-
lib/PublicInbox/LeiLsMailSource.pm | 2 +-
lib/PublicInbox/LeiMailDiff.pm | 2 +-
lib/PublicInbox/LeiRefreshMailSync.pm | 2 +-
lib/PublicInbox/LeiTag.pm | 2 +-
lib/PublicInbox/LeiXSearch.pm | 2 +-
lib/PublicInbox/Listener.pm | 8 ++------
lib/PublicInbox/NetWriter.pm | 9 +++++++++
lib/PublicInbox/SearchThread.pm | 22 +++++++++++-----------
lib/PublicInbox/SearchView.pm | 4 ++--
lib/PublicInbox/SharedKV.pm | 3 ---
lib/PublicInbox/View.pm | 4 ++--
t/lei-export-kw.t | 2 +-
t/lei-import-imap.t | 3 +++
t/thread-cycle.t | 4 ++--
19 files changed, 54 insertions(+), 38 deletions(-)
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-10-24 0:20 6% [PATCH 0/7] misc tweaks and fixes Eric Wong
2021-10-24 0:20 7% ` [PATCH 7/7] git: avoid Perl5 internal scratchpad target cache 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).