From 1ecb5ff141f6e54727c746446b52af51016e662c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sun, 9 Jun 2013 19:39:17 +0200 Subject: read-cache: add simple performance test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- test-read-cache.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test-read-cache.c (limited to 'test-read-cache.c') diff --git a/test-read-cache.c b/test-read-cache.c new file mode 100644 index 0000000000..b25bcf139b --- /dev/null +++ b/test-read-cache.c @@ -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; +} -- cgit v1.2.1