- File:
-
- 1 edited
-
doc/papers/general/evaluation/cfa-bench.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/evaluation/cfa-bench.c
r986dd36 r79d4186 1 #include <stdio.h>2 1 #include "bench.h" 3 2 #include "cfa-stack.h" 4 3 #include "cfa-pair.h" 5 #include "cfa-print.h"6 4 7 int main( int argc, char *argv[] ) { 8 FILE * out = fopen( "/dev/null", "w" ); 9 int maxi = 0, vali = 42; 10 stack(int) si, ti; 5 int main( int argc, char * argv[] ) { 6 int max = 0, val = 42; 7 stack( int ) si, ti; 11 8 12 REPEAT_TIMED( "push_int", N, push( si, val i); )9 REPEAT_TIMED( "push_int", N, push( si, val ); ) 13 10 TIMED( "copy_int", ti = si; ) 14 11 TIMED( "clear_int", clear( si ); ) 15 REPEAT_TIMED( "pop_int", N, 16 int xi = pop( ti ); 17 if ( xi > maxi ) { maxi = xi; } ) 18 REPEAT_TIMED( "print_int", N/2, print( out, vali, ":", vali, "\n" ); ) 12 REPEAT_TIMED( "pop_int", N, 13 int x = pop( ti ); if ( x > max ) max = x; ) 19 14 20 pair( _Bool, char) maxp = { (_Bool)0, '\0' }, valp = { (_Bool)1, 'a' };21 stack( pair(_Bool, char)) sp, tp;15 pair( _Bool, char ) max = { (_Bool)0 /***/, '\0' }, val = { (_Bool)1 /***/, 'a' }; 16 stack( pair( _Bool, char ) ) sp, tp; 22 17 23 REPEAT_TIMED( "push_pair", N, push( sp, val p); )18 REPEAT_TIMED( "push_pair", N, push( sp, val ); ) 24 19 TIMED( "copy_pair", tp = sp; ) 25 20 TIMED( "clear_pair", clear( sp ); ) 26 21 REPEAT_TIMED( "pop_pair", N, 27 pair(_Bool, char) xp = pop( tp ); 28 if ( xp > maxp ) { maxp = xp; } ) 29 REPEAT_TIMED( "print_pair", N/2, print( out, valp, ":", valp, "\n" ); ) 30 fclose(out); 22 pair(_Bool, char) x = pop( tp ); if ( x > max ) max = x; ) 31 23 }
Note:
See TracChangeset
for help on using the changeset viewer.