Changeset 000ff2c for doc/papers/general/evaluation/cfa-bench.c
- Timestamp:
- Mar 2, 2018, 6:22:52 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 2097cd4, 82c367d
- Parents:
- 938dd75 (diff), c9b3a41 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/evaluation/cfa-bench.c
r938dd75 r000ff2c 1 #include <stdio.h> 1 #include <fstream> 2 #include <stdlib> 2 3 #include "bench.h" 3 4 #include "cfa-stack.h" … … 5 6 #include "cfa-print.h" 6 7 7 int main( int argc, char * argv[] ) {8 FILE * out = fopen( "/dev/null", "w" );9 int max i = 0, vali= 42;10 stack( int) si, ti;8 int main( int argc, char * argv[] ) { 9 ofstream out = { "/dev/null" }; 10 int max = 0, val = 42; 11 stack( int ) si, t; 11 12 12 REPEAT_TIMED( "push_int", N, push( si, val i); )13 TIMED( "copy_int", t i= si; )13 REPEAT_TIMED( "push_int", N, push( si, val ); ) 14 TIMED( "copy_int", t = si; ) 14 15 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" ); ) 16 REPEAT_TIMED( "pop_int", N, int x = pop( t ); max = max( x, max ); ) 17 REPEAT_TIMED( "print_int", N/2, out | val | ':' | val | endl; ) 19 18 20 pair( _Bool, char) maxp = { (_Bool)0, '\0' }, valp= { (_Bool)1, 'a' };21 stack( pair(_Bool, char)) sp, tp;19 pair( _Bool, char ) max = { (_Bool)0, '\0' }, val = { (_Bool)1, 'a' }; 20 stack( pair( _Bool, char ) ) s, t; 22 21 23 REPEAT_TIMED( "push_pair", N, push( sp, valp ); ) 24 TIMED( "copy_pair", tp = sp; ) 25 TIMED( "clear_pair", clear( sp ); ) 26 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 REPEAT_TIMED( "push_pair", N, push( s, val ); ) 23 TIMED( "copy_pair", t = s; ) 24 TIMED( "clear_pair", clear( s ); ) 25 REPEAT_TIMED( "pop_pair", N, pair(_Bool, char) x = pop( t ); max = max( x, max ); ) 26 REPEAT_TIMED( "print_pair", N/2, out | val | ':' | val | endl; ) 31 27 }
Note: See TracChangeset
for help on using the changeset viewer.