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:

committed by
Junio C Hamano

parent
edca415256
commit
1ecb5ff141
13
test-read-cache.c
Normal file
13
test-read-cache.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "cache.h"
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
int i, cnt = 1;
|
||||
if (argc == 2)
|
||||
cnt = strtol(argv[1], NULL, 0);
|
||||
for (i = 0; i < cnt; i++) {
|
||||
read_cache();
|
||||
discard_cache();
|
||||
}
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user