t/perf: add basic perf tests for delta base cache
This just shows off the improvements done by the last few patches, and gives us a baseline for noticing regressions in the future. Here are the results with linux.git as the perf "large repo": Test origin HEAD ------------------------------------------------------------------- 0003.1: log --raw 43.41(40.36+2.69) 33.86(30.96+2.41) -22.0% 0003.2: log -S 313.61(309.74+3.78) 298.75(295.58+3.00) -4.7% (for a large repo, the "log -S" improvements are greater if you bump the delta base cache limit, but I think it makes sense to test the "stock" behavior, since that is what most people will see). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Aug 22, 2016 at 18:01 UTC
c7df68cbca75232f7843a7d70c58a0e98decef91
1 file changed
+31
t/perf/p0003-delta-base-cache.sh
new
+31
@@ -0,0 +1,31 @@
1
+#!/bin/sh
2
+
3
+test_description='Test operations that emphasize the delta base cache.
4
+
5
+We look at both "log --raw", which should put only trees into the delta cache,
6
+and "log -Sfoo --raw", which should look at both trees and blobs.
7
+
8
+Any effects will be emphasized if the test repository is fully packed (loose
9
+objects obviously do not use the delta base cache at all). It is also
10
+emphasized if the pack has long delta chains (e.g., as produced by "gc
11
+--aggressive"), though cache is still quite noticeable even with the default
12
+depth of 50.
13
+
14
+The setting of core.deltaBaseCacheLimit in the source repository is also
15
+relevant (depending on the size of your test repo), so be sure it is consistent
16
+between runs.
17
+'
18
+. ./perf-lib.sh
19
+
20
+test_perf_large_repo
21
+
22
+# puts mostly trees into the delta base cache
23
+test_perf 'log --raw' '
24
+ git log --raw >/dev/null
25
+'
26
+
27
+test_perf 'log -S' '
28
+ git log --raw -Sfoo >/dev/null
29
+'
30
+
31
+test_done