diff options
author | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2005-12-13 17:13:39 +0000 |
---|---|---|
committer | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2005-12-13 17:13:39 +0000 |
commit | 57ea0c26b35ca4543e64dffb55b30aa02e5f475f (patch) | |
tree | c2dd22cc147c7717f2b5ab54e45d7f1adbf07828 /perf/sarp.c | |
parent | ecb474412fd6bc406345a5a855e6743f8f2c9747 (diff) | |
download | valgrind-57ea0c26b35ca4543e64dffb55b30aa02e5f475f.tar.gz |
Remove nanosleep and adjust iteration count and array size accordingly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5329 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'perf/sarp.c')
-rw-r--r-- | perf/sarp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/perf/sarp.c b/perf/sarp.c index 368875c8b..cf803fe35 100644 --- a/perf/sarp.c +++ b/perf/sarp.c @@ -11,18 +11,18 @@ #include <assert.h> #include <time.h> -#define REPS 1000*1000 +#define REPS 1000*1000*10 int f(int i) { // This nonsense is just to ensure that the compiler does not optimise // away the stack allocation. - char big_array[8348]; - big_array[0] = 12; - big_array[2333] = 34; - big_array[5678] = 56; - big_array[8347] = 78; - assert( 8000 == (&big_array[8100] - &big_array[100]) ); + char big_array[500]; + big_array[0] = 12; + big_array[ 23] = 34; + big_array[256] = 56; + big_array[434] = 78; + assert( 480 == (&big_array[490] - &big_array[10]) ); return big_array[i]; } @@ -36,7 +36,7 @@ int main(void) // Pause for a bit so that the native run-time is not 0.00, which leads // to ridiculous slow-down figures. - nanosleep(&req, NULL); + //nanosleep(&req, NULL); for (i = 0; i < REPS; i++) { sum += f(i & 0xff); |