Skip to content

Commit cc414ca

Browse files
To1negitster
authored andcommitted
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]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f8643ab commit cc414ca

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

t/meson.build

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

t/perf/p8020-last-modified.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
git ls-tree -d HEAD >subtrees &&
18+
path="$(head -n 1 subtrees | cut -f2)" &&
19+
git last-modified -r HEAD -- "$path"
20+
'
21+
22+
test_done

0 commit comments

Comments
 (0)