diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-25 19:48:54 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-25 21:32:43 -0700 |
commit | d239ec265a345fdfdc2f12d9ffa149bfd15ca4e9 (patch) | |
tree | 14f270c362936f071359b00418a21d3090803167 /tests/zlib | |
parent | 46630aa446c6e984c5e3c745bf36cb7fa555c309 (diff) |
standardize benchmark inputs
Diffstat (limited to 'tests/zlib')
-rw-r--r-- | tests/zlib/benchmark.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/zlib/benchmark.c b/tests/zlib/benchmark.c index 9ad872e1..db1ca7d4 100644 --- a/tests/zlib/benchmark.c +++ b/tests/zlib/benchmark.c @@ -26,8 +26,16 @@ void __attribute__ ((noinline)) doit(char *buffer, int size, int i) { } int main(int argc, char **argv) { - int size = atoi(argv[1]); - int iters = atoi(argv[2]); + int size, iters; + int arg = argc > 1 ? argv[1][0] - '0' : 1; + switch(arg) { + case 0: size = 100000; iters = 250; break; + case 1: size = 100000; iters = 500; break; + case 2: size = 100000; iters = 5*500; break; + case 3: size = 100000; iters = 10*500; break; + default: printf("error: %d\\n", arg); return -1; + } + char *buffer = malloc(size); int i = 0; |