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 9F92B1F723 for ; Tue, 28 Nov 2023 14:56:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1701183389; bh=f94pciRwST7yIw0lKv13e76n/k+3S5+aEwG+voQfngQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=40RtHqaww4CXC5khhe4CljLXhS/7uB/KIUvFED4prnlMZp11EWpJ7Dh8UDnqMC1jv c0SrsJoF5y5xt2tPQxnTMp8sv7lxdSMTHSu4BSActb+gDMIQlzgapa4M5ZORE0AArv cw4GMq8eoxR+SBpwzVIdrIMz4bD9Z9Uct9+2JAWc= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 11/14] git: speed up Git->new by 5% or so Date: Tue, 28 Nov 2023 14:56:24 +0000 Message-ID: <20231128145628.1455176-12-e@80x24.org> In-Reply-To: <20231128145628.1455176-1-e@80x24.org> References: <20231128145628.1455176-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This becomes noticeable when loading lots of coderepos on my local mirror of git.kernel.org now that we can load repos from cindex. --- 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 a374649f..235a35cd 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -91,8 +91,9 @@ sub git_quote ($) { sub new { my ($class, $git_dir) = @_; + $git_dir .= '/'; $git_dir =~ tr!/!/!s; - $git_dir =~ s!/*\z!!s; + chop $git_dir; # may contain {-tmp} field for File::Temp::Dir bless { git_dir => $git_dir }, $class }