|
From: <sv...@va...> - 2005-12-13 17:13:42
|
Author: sewardj
Date: 2005-12-13 17:13:39 +0000 (Tue, 13 Dec 2005)
New Revision: 5329
Log:
Remove nanosleep and adjust iteration count and array size accordingly.
Modified:
trunk/perf/sarp.c
Modified: trunk/perf/sarp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/perf/sarp.c 2005-12-13 16:54:58 UTC (rev 5328)
+++ trunk/perf/sarp.c 2005-12-13 17:13:39 UTC (rev 5329)
@@ -11,18 +11,18 @@
#include <assert.h>
#include <time.h>
=20
-#define REPS 1000*1000
+#define REPS 1000*1000*10
=20
int f(int i)
{
// This nonsense is just to ensure that the compiler does not optimis=
e
// away the stack allocation.
- char big_array[8348];
- big_array[0] =3D 12;
- big_array[2333] =3D 34;
- big_array[5678] =3D 56;
- big_array[8347] =3D 78;
- assert( 8000 =3D=3D (&big_array[8100] - &big_array[100]) );
+ char big_array[500];
+ big_array[0] =3D 12;
+ big_array[ 23] =3D 34;
+ big_array[256] =3D 56;
+ big_array[434] =3D 78;
+ assert( 480 =3D=3D (&big_array[490] - &big_array[10]) );
return big_array[i];
}
=20
@@ -36,7 +36,7 @@
=20
// Pause for a bit so that the native run-time is not 0.00, which lea=
ds
// to ridiculous slow-down figures.
- nanosleep(&req, NULL);
+ //nanosleep(&req, NULL);
=20
for (i =3D 0; i < REPS; i++) {
sum +=3D f(i & 0xff);
|