]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Remove nanosleep and adjust iteration count and array size accordingly.
authorJulian Seward <jseward@acm.org>
Tue, 13 Dec 2005 17:13:39 +0000 (17:13 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 13 Dec 2005 17:13:39 +0000 (17:13 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5329

perf/sarp.c

index 368875c8b97afe0466f5a49d465674199e1ba9b3..cf803fe35a9f735ea9901a11f304e08212d06b37 100644 (file)
 #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);