diff options
Diffstat (limited to '_support/git-patches/v2.33.1.gl3/0004-revision-stop-retrieving-reference-twice.patch')
-rw-r--r-- | _support/git-patches/v2.33.1.gl3/0004-revision-stop-retrieving-reference-twice.patch | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/_support/git-patches/v2.33.1.gl3/0004-revision-stop-retrieving-reference-twice.patch b/_support/git-patches/v2.33.1.gl3/0004-revision-stop-retrieving-reference-twice.patch deleted file mode 100644 index aa00f75f1..000000000 --- a/_support/git-patches/v2.33.1.gl3/0004-revision-stop-retrieving-reference-twice.patch +++ /dev/null @@ -1,56 +0,0 @@ -From bf9c0cbddbcd730e4312ba5e19f8b8a2edd65bb3 Mon Sep 17 00:00:00 2001 -Message-Id: <bf9c0cbddbcd730e4312ba5e19f8b8a2edd65bb3.1630319075.git.ps@pks.im> -In-Reply-To: <29ef1f27fed21b5b7d3c996a01f1364e7e841917.1630319075.git.ps@pks.im> -References: <29ef1f27fed21b5b7d3c996a01f1364e7e841917.1630319075.git.ps@pks.im> -From: Patrick Steinhardt <ps@pks.im> -Date: Mon, 9 Aug 2021 10:11:54 +0200 -Subject: [PATCH 4/6] revision: stop retrieving reference twice -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When queueing up references for the revision walk, `handle_one_ref()` -will resolve the reference's object ID via `get_reference()` and then -queue the ID as pending object via `add_pending_oid()`. But given that -`add_pending_oid()` is only a thin wrapper around `add_pending_object()` -which fist calls `get_reference()`, we effectively resolve the reference -twice and thus duplicate some of the work. - -Fix the issue by instead calling `add_pending_object()` directly, which -takes the already-resolved object as input. In a repository with lots of -refs, this translates into a near 10% speedup: - - Benchmark #1: HEAD~: rev-list --unsorted-input --objects --quiet --not --all --not $newrev - Time (mean ± σ): 5.015 s ± 0.038 s [User: 4.698 s, System: 0.316 s] - Range (min … max): 4.970 s … 5.089 s 10 runs - - Benchmark #2: HEAD: rev-list --unsorted-input --objects --quiet --not --all --not $newrev - Time (mean ± σ): 4.606 s ± 0.029 s [User: 4.260 s, System: 0.345 s] - Range (min … max): 4.565 s … 4.657 s 10 runs - - Summary - 'HEAD: rev-list --unsorted-input --objects --quiet --not --all --not $newrev' ran - 1.09 ± 0.01 times faster than 'HEAD~: rev-list --unsorted-input --objects --quiet --not --all --not $newrev' - -Signed-off-by: Patrick Steinhardt <ps@pks.im> -Signed-off-by: Junio C Hamano <gitster@pobox.com> ---- - revision.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/revision.c b/revision.c -index 47541407d2..80a59896b9 100644 ---- a/revision.c -+++ b/revision.c -@@ -1534,7 +1534,7 @@ static int handle_one_ref(const char *path, const struct object_id *oid, - - object = get_reference(cb->all_revs, path, oid, cb->all_flags); - add_rev_cmdline(cb->all_revs, object, path, REV_CMD_REF, cb->all_flags); -- add_pending_oid(cb->all_revs, path, oid, cb->all_flags); -+ add_pending_object(cb->all_revs, object, path); - return 0; - } - --- -2.33.0 - |