user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 5/7] inbox: do not waste hash slot on httpbackend_limiter
  2021-09-22  2:24  4% [PATCH 0/7] lei bugfixes and other fixes Eric Wong
@ 2021-09-22  2:24  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-09-22  2:24 UTC (permalink / raw)
  To: meta

A few dozen bytes saved here can add up when we have thousands
of inboxes.  It also makes Data::Dumper debug output a bit cleaner.
---
 lib/PublicInbox/Inbox.pm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index 6cd20ec0..20f8c884 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -126,11 +126,12 @@ sub version {
 
 sub git_epoch {
 	my ($self, $epoch) = @_; # v2-only, callers always supply $epoch
-	$self->{"$epoch.git"} ||= do {
+	$self->{"$epoch.git"} //= do {
 		my $git_dir = "$self->{inboxdir}/git/$epoch.git";
 		return unless -d $git_dir;
 		my $g = PublicInbox::Git->new($git_dir);
-		$g->{-httpbackend_limiter} = $self->{-httpbackend_limiter};
+		my $lim = $self->{-httpbackend_limiter};
+		$g->{-httpbackend_limiter} = $lim if $lim;
 		# caller must manually cleanup when done
 		$g;
 	};
@@ -138,11 +139,12 @@ sub git_epoch {
 
 sub git {
 	my ($self) = @_;
-	$self->{git} ||= do {
+	$self->{git} //= do {
 		my $git_dir = $self->{inboxdir};
 		$git_dir .= '/all.git' if $self->version == 2;
 		my $g = PublicInbox::Git->new($git_dir);
-		$g->{-httpbackend_limiter} = $self->{-httpbackend_limiter};
+		my $lim = $self->{-httpbackend_limiter};
+		$g->{-httpbackend_limiter} = $lim if $lim;
 		_cleanup_later($self);
 		$g;
 	};

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/7] lei bugfixes and other fixes
@ 2021-09-22  2:24  4% Eric Wong
  2021-09-22  2:24  7% ` [PATCH 5/7] inbox: do not waste hash slot on httpbackend_limiter Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-09-22  2:24 UTC (permalink / raw)
  To: meta

How did I forget 2/7 for all these months? :<

6/7 took a while for me to figure out, I only noticed it
because of background processes running after MUA exit
(from "lei up --mua=... MFOLDER"), but I got 4/7 and 7/7
fixes out of it.

Eric Wong (7):
  ipc: do not add "0" to $0 of solo workers
  treewide: fix %SIG localization, harder
  script/lei: describe purpose of sleep loop
  lei: dclose: do not close unnecessarily
  inbox: do not waste hash slot on httpbackend_limiter
  lei up: avoid excessively parallel --all
  lei: drop redundant WQ EOF callbacks

 lib/PublicInbox/Admin.pm        |  2 +-
 lib/PublicInbox/ExtSearchIdx.pm |  4 +-
 lib/PublicInbox/IPC.pm          |  7 +--
 lib/PublicInbox/Inbox.pm        | 10 ++--
 lib/PublicInbox/LEI.pm          |  3 +-
 lib/PublicInbox/LeiImportKw.pm  |  8 +--
 lib/PublicInbox/LeiMirror.pm    | 10 +---
 lib/PublicInbox/LeiNoteEvent.pm |  8 +--
 lib/PublicInbox/LeiPmdir.pm     |  8 +--
 lib/PublicInbox/LeiUp.pm        | 86 +++++++++++++++++++++------------
 lib/PublicInbox/TestCommon.pm   |  3 +-
 lib/PublicInbox/Watch.pm        |  4 +-
 lib/PublicInbox/Xapcmd.pm       |  8 +--
 script/lei                      |  2 +-
 script/public-inbox-clone       |  2 +-
 t/run.perl                      |  1 +
 16 files changed, 86 insertions(+), 80 deletions(-)

^ permalink raw reply	[relevance 4%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-09-22  2:24  4% [PATCH 0/7] lei bugfixes and other fixes Eric Wong
2021-09-22  2:24  7% ` [PATCH 5/7] inbox: do not waste hash slot on httpbackend_limiter 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).