unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 4/4] codesearch: deduplicate $git->{nick} field
Date: Mon, 11 Mar 2024 19:40:12 +0000	[thread overview]
Message-ID: <20240311194012.1266143-5-e@80x24.org> (raw)
In-Reply-To: <20240311194012.1266143-1-e@80x24.org>

While PublicInbox::Config is responsible for some instances of
setting $git->{nick}, more PublicInbox::Git objects may be
created from loading the cindex and we should do our best to
reuse that memory, too.

Followup-to: 84ed7ec1c887 (dedupe inbox names, coderepo nicks + git dirs, 2024-03-04)
---
 lib/PublicInbox/CodeSearch.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/CodeSearch.pm b/lib/PublicInbox/CodeSearch.pm
index 48033bb5..e5fa4480 100644
--- a/lib/PublicInbox/CodeSearch.pm
+++ b/lib/PublicInbox/CodeSearch.pm
@@ -283,7 +283,8 @@ EOM
 		$nick =~ s!$lre!$nick_pfx!s or next;
 		$dir2cr{$p} = $coderepos->{$nick} //= do {
 			my $git = PublicInbox::Git->new($p);
-			$git->{nick} = $nick; # for git->pub_urls
+			my %dedupe = ($nick => undef);
+			($git->{nick}) = keys %dedupe; # for git->pub_urls
 			$git;
 		};
 	}

      parent reply	other threads:[~2024-03-11 19:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 19:40 [PATCH 0/4] memory reductions for WWW + solver Eric Wong
2024-03-11 19:40 ` [PATCH 1/4] www: use a dedicated limiter for blob solver Eric Wong
2024-03-11 19:40 ` [PATCH 2/4] codesearch: deduplicate {ibx_score} name pairs Eric Wong
2024-03-11 19:40 ` [PATCH 3/4] doc: tuning: note reduced fragmentation w/ jemalloc Eric Wong
2024-03-11 19:40 ` Eric Wong [this message]

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

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240311194012.1266143-5-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.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: link
Be 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).