From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 17CEC1F724 for ; Thu, 30 Nov 2023 11:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1701344471; bh=kgAa6DqaEIyf71snTiZ1J+pe7mfjcBJpKOmEBkjwLlE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Zo6hrKnLW2euK0rQgyIJ9uLdGbYRPqOcKyosnHug/3Yo9RexhPg/ga5Rw7BVr4W8h CHLrjFvNQy+Q3J7E5qCQFLCUqgpePmgyYsulCM/Y8+MN7EY9bMfSOakb4Tnsh0we89 IhJKils47vUnAac4q7ho22yEskClE+T9V4rp58T8= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 12/15] git_async_cat: use git from "all" extindex if possible Date: Thu, 30 Nov 2023 11:41:05 +0000 Message-ID: <20231130114109.2577708-13-e@80x24.org> In-Reply-To: <20231130114109.2577708-1-e@80x24.org> References: <20231130114109.2577708-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: For inboxes associated with an extindex (currently only the special "all") one, we can share the git process across all those inboxes unambiguously when retrieving full SHA-1 blobs. The comment for my proposed patch is also out-of-date as that git speedup has been a part of git since 2.33. --- lib/PublicInbox/GitAsyncCat.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/GitAsyncCat.pm b/lib/PublicInbox/GitAsyncCat.pm index 09744b34..f57e0336 100644 --- a/lib/PublicInbox/GitAsyncCat.pm +++ b/lib/PublicInbox/GitAsyncCat.pm @@ -9,11 +9,11 @@ our $GCF2C; # singleton PublicInbox::Gcf2Client sub ibx_async_cat ($$$$) { my ($ibx, $oid, $cb, $arg) = @_; - my $git = $ibx->{git} // $ibx->git; + my $isrch = $ibx->{isrch}; + my $git = $isrch ? $isrch->{es}->git : ($ibx->{git} // $ibx->git); # {topdir} means ExtSearch (likely [extindex "all"]) with potentially - # 100K alternates. git(1) has a proposed patch for 100K alternates: - # - if (!defined($ibx->{topdir}) && !defined($git->{-tmp}) && + # 100K alternates. git v2.33+ can handle 100k alternates fairly well. + if (!$isrch && !defined($ibx->{topdir}) && !defined($git->{-tmp}) && ($GCF2C //= eval { require PublicInbox::Gcf2Client; PublicInbox::Gcf2Client::new();