read-cache: add simple performance test

Add the helper test-read-cache, which can be used to call read_cache and
discard_cache in a loop as well as a performance check based on it.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe
2013-06-09 19:39:17 +02:00
committed by Junio C Hamano
parent edca415256
commit 1ecb5ff141
4 changed files with 29 additions and 0 deletions

14
t/perf/p0002-read-cache.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
test_description="Tests performance of reading the index"
. ./perf-lib.sh
test_perf_default_repo
count=1000
test_perf "read_cache/discard_cache $count times" "
test-read-cache $count
"
test_done