[PATCH RFC v3 2/3] t/perf: add last-modified perf script
- From
Toon Claes <toon@iotcl.com>
- Date
- Jun 30, 2025, 18:49 UTC
- Message-ID
- <20250630-toon-new-blame-tree-v3-2-3516025dc3bc@iotcl.com>
- In-Reply-To
- <20250630-toon-new-blame-tree-v3-0-3516025dc3bc@iotcl.com>
This just runs some simple last-modified commands. We already test correctness in the regular suite, so this is just about finding performance regressions from one version to another.
Based-on-patch-by: Jeff King <peff@peff.net> Signed-off-by: Toon Claes <toon@iotcl.com> --- t/meson.build | 1 + t/perf/p8020-last-modified.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+)
diff --git a/t/meson.build b/t/meson.build index 44eb2a693f..09f83d89ca 100644 --- a/t/meson.build +++ b/t/meson.build @@ -1155,6 +1155,7 @@ benchmarks = [ 'perf/p7820-grep-engines.sh', 'perf/p7821-grep-engines-fixed.sh', 'perf/p7822-grep-perl-character.sh', + 'perf/p8020-last-modified.sh', 'perf/p9210-scalar.sh', 'perf/p9300-fast-import-export.sh', ] diff --git a/t/perf/p8020-last-modified.sh b/t/perf/p8020-last-modified.sh new file mode 100755 index 0000000000..a02ec907d4 --- /dev/null +++ b/t/perf/p8020-last-modified.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +test_description='last-modified perf tests' +. ./perf-lib.sh + +test_perf_default_repo + +test_perf 'top-level last-modified' ' + git last-modified HEAD +' + +test_perf 'top-level recursive last-modified' ' + git last-modified -r HEAD +' + +test_perf 'subdir last-modified' ' + path=$(git ls-tree HEAD | grep ^040000 | head -n 1 | cut -f2) + git last-modified -r HEAD -- "$path" +' + +test_done
-- 2.50.0.rc0.18.gfcfe60668e