From: Jon Simons <jon@jonsimons.org>
To: git@vger.kernel.org
Cc: Jon Simons <jon@jonsimons.org>
Subject: [PATCH 04/15] t/perf: add explicit delete refspec matching test
Date: Fri, 9 Oct 2026 15:29:42 -0400 [thread overview]
Message-ID: <20261009192953.81794-5-jon@jonsimons.org> (raw)
In-Reply-To: <20261009192953.81794-1-jon@jonsimons.org>
Add p5516 to measure the client-side cost of matching explicit
refspecs on 'git push' against a server that advertises many refs.
The server gets 100k branches, and two clients push 1, 10, 100 delete
refspecs each with --dry-run: an empty client (no local refs), which
isolates matching against the advertised refs, and a mirror client
(full local copy of server refs), to exercise matching against the
same number of local refs. Delete refspecs and --dry-run are used
to avoid any object transfer or ref update activity in the measurement
and leave the scratch repos unmodified, such that each repetition does
the same amount of matching work.
The test is used to demonstrate speedups in subsequent commits.
Baseline numbers on my machine:
Test this tree
----------------------------------------------
5516.3: empty:refspecs:1 0.14(0.08+0.10)
5516.5: empty:refspecs:10 0.38(0.32+0.10)
5516.7: empty:refspecs:100 2.50(2.44+0.10)
5516.9: mirror:refspecs:1 0.21(0.14+0.11)
5516.11: mirror:refspecs:10 0.80(0.73+0.11)
5516.13: mirror:refspecs:100 6.85(6.78+0.12)
Signed-off-by: Jon Simons <jon@jonsimons.org>
---
t/perf/p5516-push-delete-refspec.sh | 42 +++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100755 t/perf/p5516-push-delete-refspec.sh
diff --git a/t/perf/p5516-push-delete-refspec.sh b/t/perf/p5516-push-delete-refspec.sh
new file mode 100755
index 0000000000..0e425193e5
--- /dev/null
+++ b/t/perf/p5516-push-delete-refspec.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+test_description='explicit delete refspec matching on push
+
+Measure client-side matching of explicit delete refspecs with "git push
+--dry-run" against a server that advertises lots of refs. An empty client
+(no local refs) and a mirror client (full local copy of the server refs)
+are tested pushing 1, 10, and 100 refspecs each.
+'
+. ./perf-lib.sh
+
+test_perf_fresh_repo
+
+ref_count=100000
+
+test_expect_success 'create server with many refs and two clients' '
+ test_commit base &&
+ git clone --bare --ref-format=reftable . server &&
+ test_seq -f "create refs/heads/b%d HEAD" $ref_count |
+ git -C server update-ref --stdin &&
+ git init --bare client_empty &&
+ git -C client_empty remote add origin "$PWD/server" &&
+ git clone --mirror --ref-format=reftable "$PWD/server" client_mirror &&
+ git -C client_mirror config --unset remote.origin.mirror
+'
+
+for mode in empty mirror
+do
+ client=client_$mode
+ for nr_refspecs in 1 10 100
+ do
+ test_expect_success "create $mode refspecs: $nr_refspecs" '
+ test_seq -f ":refs/heads/b%d" $nr_refspecs >refspecs
+ '
+
+ test_perf "$mode:refspecs:$nr_refspecs" '
+ git -C '"$client"' push --dry-run origin $(cat refspecs)
+ '
+ done
+done
+
+test_done
--
2.55.0
next prev parent reply other threads:[~2026-10-09 19:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 19:29 [PATCH 00/15] push: speed up client-side refspec matching Jon Simons
2026-10-09 19:29 ` [PATCH 01/15] remote: validate --force-with-lease <refname> argument Jon Simons
2026-10-09 19:29 ` [PATCH 02/15] t5516: demonstrate push with "./"-prefixed source Jon Simons
2026-10-09 19:29 ` [PATCH 03/15] t5510: document fetch with "./"-prefixed branch.<name>.merge Jon Simons
2026-10-09 19:29 ` Jon Simons [this message]
2026-10-09 19:29 ` [PATCH 05/15] refs: stop using mkpath() in refname_match() Jon Simons
2026-10-09 19:29 ` [PATCH 06/15] remote: use strmap for check_push_refs() Jon Simons
2026-10-09 19:29 ` [PATCH 07/15] t5516: test pushing two refspecs creating the same new branch Jon Simons
2026-10-09 19:29 ` [PATCH 08/15] t5408, t5410: test duplicate updates without relying on the client Jon Simons
2026-10-09 19:29 ` [PATCH 09/15] t5408: check refspec order with distinct destinations Jon Simons
2026-10-09 19:29 ` [PATCH 10/15] t5408: expect client-side error for duplicate destinations Jon Simons
2026-10-09 19:29 ` [PATCH 11/15] remote: reject duplicate destinations on an empty remote Jon Simons
2026-10-09 19:29 ` [PATCH 12/15] remote: use strmap for match_explicit_refs() Jon Simons
2026-10-09 19:29 ` [PATCH 13/15] t/perf: measure --force-with-lease in p5516 Jon Simons
2026-10-09 19:29 ` [PATCH 14/15] remote: restructure apply_push_cas() loops Jon Simons
2026-10-09 19:29 ` [PATCH 15/15] remote: use strmap for apply_push_cas() Jon Simons
2026-10-09 20:18 ` [PATCH 00/15] push: speed up client-side refspec matching Kristoffer Haugsbakk
2026-10-11 2:35 ` Jon Simons
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261009192953.81794-5-jon@jonsimons.org \
--to=jon@jonsimons.org \
--cc=git@vger.kernel.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