Skip to content

Commit a017f2c

Browse files
committed
t/perf: add last-modified perf script
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 <[email protected]> Signed-off-by: Toon Claes <[email protected]>
1 parent 0cc625f commit a017f2c

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

t/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,7 @@ benchmarks = [
11541154
'perf/p7820-grep-engines.sh',
11551155
'perf/p7821-grep-engines-fixed.sh',
11561156
'perf/p7822-grep-perl-character.sh',
1157+
'perf/p8020-last-modified.sh',
11571158
'perf/p9210-scalar.sh',
11581159
'perf/p9300-fast-import-export.sh',
11591160
]

t/perf/p8020-last-modified.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
test_description='last-modified perf tests'
4+
. ./perf-lib.sh
5+
6+
test_perf_default_repo
7+
8+
test_perf 'top-level last-modified' '
9+
git last-modified HEAD
10+
'
11+
12+
test_perf 'top-level recursive last-modified' '
13+
git last-modified -r HEAD
14+
'
15+
16+
test_perf 'subdir last-modified' '
17+
path=$(git ls-tree HEAD | grep ^040000 | head -n 1 | cut -f2)
18+
git last-modified -r HEAD -- "$path"
19+
'
20+
21+
test_done

0 commit comments

Comments
 (0)