Thread (79 messages) 79 messages, 10 authors, 2025-08-05
STALE323d
Revisions (6)
  1. v2 [diff vs current]
  2. v3 [diff vs current]
  3. v3 [diff vs current]
  4. v5 [diff vs current]
  5. v5 [diff vs current]
  6. v6 current

[PATCH v7 2/3] t/perf: add last-modified perf script

From: Toon Claes <hidden>
Date: 2025-08-05 09:34:30
Subsystem: the rest · Maintainer: Linus Torvalds

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 [off-list ref]
Signed-off-by: Toon Claes <redacted>
---
 t/meson.build                 |  1 +
 t/perf/p8020-last-modified.sh | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 100755 t/perf/p8020-last-modified.sh
diff --git a/t/meson.build b/t/meson.build
index 68656fe08a..21d5e99bf5 100644
--- a/t/meson.build
+++ b/t/meson.build
@@ -1140,6 +1140,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..cb1f98d3db
--- /dev/null
+++ b/t/perf/p8020-last-modified.sh
@@ -0,0 +1,22 @@
+#!/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' '
+	git ls-tree -d HEAD >subtrees &&
+	path="$(head -n 1 subtrees | cut -f2)" &&
+	git last-modified -r HEAD -- "$path"
+'
+
+test_done
-- 
2.50.1.327.g047016eb4a
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help