- Timestamp:
- Jan 19, 2020, 4:16:27 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- f090750
- Parents:
- 9e63a2b
- Location:
- benchmark
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/Makefile.am
r9e63a2b r2316525 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Fri Jan 10 11:29:52 202014 ## Update Count : 23 013 ## Last Modified On : Sun Jan 19 12:55:02 2020 14 ## Update Count : 232 15 15 ############################################################################### 16 16 … … 83 83 basic_loop_DURATION = 15000000000 84 84 basic_function_DURATION = 10000000000 85 basic_tls_fetch_add_DURATION = 10000000000 85 86 basic_DURATION = 250000000 86 87 … … 291 292 ctxswitch-nodejs_coroutine$(EXEEXT): 292 293 echo "#!/bin/sh" > a.out 293 echo "node $(srcdir)/ctxswitch/node_cor.js" >> a.out294 echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out 294 295 chmod a+x a.out 295 296 … … 434 435 creation-nodejs_coroutine$(EXEEXT): 435 436 echo "#!/bin/sh" > a.out 436 echo "node $(srcdir)/creation/node_cor.js" >> a.out437 echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out 437 438 chmod a+x a.out 438 439 -
benchmark/Makefile.in
r9e63a2b r2316525 421 421 basic_loop_DURATION = 15000000000 422 422 basic_function_DURATION = 10000000000 423 basic_tls_fetch_add_DURATION = 10000000000 423 424 basic_DURATION = 250000000 424 425 ctxswitch_pthread_DURATION = 25000000 … … 933 934 ctxswitch-nodejs_coroutine$(EXEEXT): 934 935 echo "#!/bin/sh" > a.out 935 echo "node $(srcdir)/ctxswitch/node_cor.js" >> a.out936 echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out 936 937 chmod a+x a.out 937 938 … … 1068 1069 creation-nodejs_coroutine$(EXEEXT): 1069 1070 echo "#!/bin/sh" > a.out 1070 echo "node $(srcdir)/creation/node_cor.js" >> a.out1071 echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out 1071 1072 chmod a+x a.out 1072 1073 -
benchmark/creation/cfa_cor.cfa
r9e63a2b r2316525 5 5 6 6 coroutine MyCoroutine {}; 7 void ?{} (MyCoroutine & this) {7 void ?{}( MyCoroutine & this ) { 8 8 #ifdef EAGER 9 resume( this);9 resume( this ); 10 10 #endif 11 11 } 12 void main( MyCoroutine &) {}12 void main( MyCoroutine & ) {} 13 13 14 14 int main( int argc, char * argv[] ) { 15 15 BENCH_START() 16 16 BENCH( 17 for ( i;times ) {18 MyCoroutine m;17 for ( times ) { 18 MyCoroutine c; 19 19 }, 20 20 result -
benchmark/creation/cfa_thrd.cfa
r9e63a2b r2316525 10 10 BENCH_START() 11 11 BENCH( 12 for ( i;times ) {12 for ( times ) { 13 13 MyThread m; 14 14 }, -
benchmark/creation/node_cor.js
r9e63a2b r2316525 4 4 if ( argc == 3 ) times = Number( process.argv[2] ) 5 5 6 function * coroutine() { 7 } 6 function * coroutine() {} 8 7 var hrstart = process.hrtime() 9 8 for ( var i = 0; i < times; i += 1 ) { -
benchmark/ctxswitch/cfa_cor.cfa
r9e63a2b r2316525 4 4 #include "bench.h" 5 5 6 coroutine GreatSuspender {};7 void main( __attribute__((unused)) GreatSuspender & this) {8 while ( true) {6 coroutine C {} c; 7 void main( __attribute__((unused)) C & ) { 8 while () { 9 9 suspend(); 10 10 } … … 12 12 int main( int argc, char * argv[] ) { 13 13 BENCH_START() 14 GreatSuspender s;15 14 BENCH( 16 for ( i;times ) {17 resume( s);15 for ( times ) { 16 resume( c ); 18 17 }, 19 18 result -
benchmark/ctxswitch/cfa_cor_then.cfa
r9e63a2b r2316525 6 6 void noOp(void) {} 7 7 8 coroutine GreatSuspender {};8 coroutine C {} c; 9 9 10 void ?{}( GreatSuspender& this ) {10 void ?{}( C & this ) { 11 11 prime(this); 12 12 } 13 13 14 void main( __attribute__((unused)) GreatSuspender& this ) {15 while ( true) {14 void main( __attribute__((unused)) C & this ) { 15 while () { 16 16 suspend_then(noOp); 17 17 } … … 20 20 int main( int argc, char * argv[] ) { 21 21 BENCH_START() 22 GreatSuspender s;23 22 BENCH( 24 for ( i;times ) {25 resume( s);23 for ( times ) { 24 resume( c ); 26 25 }, 27 26 result -
benchmark/ctxswitch/cfa_gen.cfa
r9e63a2b r2316525 3 3 typedef struct { 4 4 void * next; 5 } GreatSuspender;5 } C; 6 6 7 void comain( GreatSuspender * this) {8 if ( __builtin_expect( this->next != 0, 1) ) goto *(this->next);9 this->next = &&s1;7 void comain( C * c ) { 8 if ( __builtin_expect(c->next != 0, 1) ) goto *(c->next); 9 c->next = &&s1; 10 10 for () { 11 11 return; … … 16 16 int main( int argc, char * argv[] ) { 17 17 BENCH_START() 18 GreatSuspender s= { 0 };18 C c = { 0 }; 19 19 BENCH( 20 for ( i;times ) {21 comain( & s);20 for ( times ) { 21 comain( &c ); 22 22 }, 23 23 result -
benchmark/ctxswitch/cfa_thrd.cfa
r9e63a2b r2316525 6 6 BENCH_START() 7 7 BENCH( 8 for ( i;times ) {8 for ( times ) { 9 9 yield(); 10 10 }, -
benchmark/ctxswitch/cfa_thrd2.cfa
r9e63a2b r2316525 8 8 9 9 void main(__attribute__((unused)) Fibre & this) { 10 while (!done) {10 while ( ! done ) { 11 11 yield(); 12 12 } … … 17 17 Fibre f1; 18 18 BENCH( 19 for ( i;times ) {19 for ( times ) { 20 20 yield(); 21 21 }, -
benchmark/ctxswitch/python_cor.py
r9e63a2b r2316525 9 9 times = int( sys.argv[1] ) 10 10 11 def GreatSuspender():11 def C(): 12 12 while True: 13 13 yield 14 14 15 s = GreatSuspender()15 c = C() 16 16 17 17 start = time.time_ns() 18 18 for i in range( 10000000 ): 19 next( s) # resume19 next( c ) # resume 20 20 end = time.time_ns() 21 21 print( (end - start) / times ) -
benchmark/ctxswitch/upp_cor.cc
r9e63a2b r2316525 3 3 #include "bench.h" 4 4 5 _Coroutine GreatSuspender{5 _Coroutine C { 6 6 void main() { 7 7 while( true ) { … … 13 13 resume(); 14 14 } 15 } ;15 } c; 16 16 int main( int argc, char * argv[] ) { 17 17 BENCH_START() 18 GreatSuspender s;19 18 BENCH( 20 19 for (size_t i = 0; i < times; i++) { 21 s.do_resume();20 c.do_resume(); 22 21 }, 23 22 result -
benchmark/mutex/cfa1.cfa
r9e63a2b r2316525 4 4 #include "bench.h" 5 5 6 monitor M {} ;7 void __attribute__((noinline)) call( M & mutex m) {}6 monitor M {} m1; 7 void __attribute__((noinline)) call( M & mutex p1 ) {} 8 8 9 9 int main( int argc, char * argv[] ) { 10 10 BENCH_START() 11 M m;12 11 BENCH( 13 for ( i;times ) {14 call( m );12 for ( times ) { 13 call( m1 ); 15 14 }, 16 15 result -
benchmark/mutex/cfa2.cfa
r9e63a2b r2316525 4 4 #include "bench.h" 5 5 6 monitor M {}; 7 void __attribute__((noinline)) call( M & mutex m1, M & mutex m2 ) {} 6 monitor M {} m1, m2; 7 8 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {} 8 9 9 10 int main( int argc, char * argv[] ) { 10 11 BENCH_START() 11 M m1, m2;12 12 BENCH( 13 for ( i;times ) {13 for ( times ) { 14 14 call( m1, m2 ); 15 15 }, -
benchmark/mutex/cfa4.cfa
r9e63a2b r2316525 5 5 6 6 7 monitor M {} ;8 void __attribute__((noinline)) call( M & mutex m1, M & mutex m2, M & mutex m3, M & mutex m4 ) {}7 monitor M {} m1, m2, m3, m4; 8 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {} 9 9 10 10 int main( int argc, char * argv[] ) { 11 11 BENCH_START() 12 M m1, m2, m3, m4;13 12 BENCH( 14 for ( i;times ) {13 for ( times ) { 15 14 call( m1, m2, m3, m4 ); 16 15 }, -
benchmark/mutexC/cfa1.cfa
r9e63a2b r2316525 11 11 void call() { 12 12 go = true; 13 for ( i;times ) {13 for ( times ) { 14 14 call( m ); 15 15 } -
benchmark/mutexC/cfa2.cfa
r9e63a2b r2316525 11 11 void call() { 12 12 go = true; 13 for ( i;times ) {13 for ( times ) { 14 14 call( m1, m2 ); 15 15 } -
benchmark/mutexC/cfa4.cfa
r9e63a2b r2316525 11 11 void call() { 12 12 go = true; 13 for ( i;times ) {13 for ( times ) { 14 14 call( m1, m2, m3, m4 ); 15 15 } -
benchmark/schedext/cfa1.cfa
r9e63a2b r2316525 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 8 volatile int go = 0; 9 9 10 monitor M {}; 11 M m1; 10 monitor M {} m1; 12 11 13 void __attribute__((noinline)) call( M & mutex a1 ) {}12 void __attribute__((noinline)) call( M & mutex p1 ) {} 14 13 15 int __attribute__((noinline)) wait( M & mutex a1 ) {14 void __attribute__((noinline)) wait( M & mutex p1 ) { 16 15 go = 1; 17 for ( i;times ) {18 waitfor( call : a1);16 for ( times ) { 17 waitfor( call : p1 ); 19 18 } 20 19 go = 0; 21 return 0;22 20 } 23 21 24 22 thread T {}; 25 void ^?{}( T & mutex this ) {}26 23 void main( T & ) { 27 while (go == 0) { yield(); }24 while ( go == 0 ) { yield(); } 28 25 BENCH( 29 while (go == 1) { call(m1); },26 while ( go == 1 ) { call( m1 ); }, 30 27 result 31 28 ) … … 36 33 BENCH_START() 37 34 T t; 38 returnwait( m1 );35 wait( m1 ); 39 36 } 40 37 -
benchmark/schedext/cfa2.cfa
r9e63a2b r2316525 8 8 volatile int go = 0; 9 9 10 monitor M {}; 11 M m1, m2; 10 monitor M {} m1, m2; 12 11 13 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2 ) {}12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {} 14 13 15 int __attribute__((noinline)) wait( M & mutex a1, M & mutex a2 ) {14 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) { 16 15 go = 1; 17 for ( i;times ) {18 waitfor( call : a1, a2);16 for ( times ) { 17 waitfor( call : p1, p2 ); 19 18 } 20 19 go = 0; 21 return 0;22 20 } 23 21 24 22 thread T {}; 25 void ^?{}( T & mutex this ) {}26 23 void main( T & ) { 27 while( go == 0) { yield(); }24 while( go == 0 ) { yield(); } 28 25 BENCH( 29 while (go == 1) { call(m1, m2); },26 while ( go == 1 ) { call( m1, m2 ); }, 30 27 result 31 28 ) … … 36 33 BENCH_START() 37 34 T t; 38 returnwait( m1, m2 );35 wait( m1, m2 ); 39 36 } 40 37 -
benchmark/schedext/cfa4.cfa
r9e63a2b r2316525 8 8 volatile int go = 0; 9 9 10 monitor M {}; 11 M m1, m2, m3, m4; 10 monitor M {} m1, m2, m3, m4; 12 11 13 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {}12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {} 14 13 15 int __attribute__((noinline)) wait( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {14 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) { 16 15 go = 1; 17 for ( i;times ) {18 waitfor( call : a1, a2, a3, a4 );16 for ( times ) { 17 waitfor( call : p1, p2, p3, p4 ); 19 18 } 20 19 go = 0; 21 return 0;22 20 } 23 21 24 22 thread T {}; 25 void ^?{}( T & mutex this ) {}26 23 void main( T & ) { 27 while( go == 0) { yield(); }24 while( go == 0 ) { yield(); } 28 25 BENCH( 29 while( go == 1) { call(m1, m2, m3, m4); },26 while( go == 1 ) { call( m1, m2, m3, m4 ); }, 30 27 result 31 28 ) … … 36 33 BENCH_START() 37 34 T t; 38 returnwait( m1, m2, m3, m4 );35 wait( m1, m2, m3, m4 ); 39 36 } 40 37 -
benchmark/schedext/upp.cc
r9e63a2b r2316525 11 11 int __attribute__((noinline)) wait() { 12 12 go = 1; 13 for ( size_t i = 0; i < times; i++) {13 for ( size_t i = 0; i < times; i++ ) { 14 14 _Accept(call); 15 15 } … … 17 17 return 0; 18 18 } 19 }; 20 21 M m; 19 } m; 22 20 23 21 _Task T { 24 22 void main() { 25 while (go == 0) { yield(); }23 while ( go == 0 ) { yield(); } 26 24 BENCH( 27 while (go == 1) { m.call(); },25 while ( go == 1 ) { m.call(); }, 28 26 result 29 27 ) -
benchmark/schedint/cfa1.cfa
r9e63a2b r2316525 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 8 volatile int go = 0; 9 condition c; 10 monitor M {} m1; 9 11 10 condition c; 11 monitor M {}; 12 M m1; 13 14 void __attribute__((noinline)) call( M & mutex a1 ) { 15 signal(c); 12 void __attribute__((noinline)) call( M & mutex p1 ) { 13 signal( c ); 16 14 } 17 15 18 int __attribute__((noinline)) wait( M & mutex a1 ) {16 void __attribute__((noinline)) wait( M & mutex p1 ) { 19 17 go = 1; 18 for ( times ) { 19 wait( c ); 20 } 21 go = 0; 22 } 23 24 thread T {}; 25 void main( T & ) { 26 while ( go == 0 ) { yield(); } 20 27 BENCH( 21 for ( i; times ) { 22 wait(c); 23 }, 28 while ( go == 1 ) { call( m1 ); }, 24 29 result 25 30 ) 26 31 printf( "%g\n", result ); 27 go = 0;28 return 0;29 }30 31 thread T {};32 void ^?{}( T & mutex ) {}33 void main( T & ) {34 while(go == 0) { yield(); }35 while(go == 1) { call(m1); }36 37 32 } 38 33 … … 40 35 BENCH_START() 41 36 T t; 42 return wait(m1);37 wait( m1 ); 43 38 } 44 39 -
benchmark/schedint/cfa2.cfa
r9e63a2b r2316525 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 8 volatile int go = 0; 9 condition c; 10 monitor M {} m1, m2; 9 11 10 condition c; 11 monitor M {}; 12 M m1, m2; 13 14 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2 ) { 15 signal(c); 12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) { 13 signal( c ); 16 14 } 17 15 18 int __attribute__((noinline)) wait( M & mutex a1, M & mutex a2 ) {16 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) { 19 17 go = 1; 18 for ( times ) { 19 wait( c ); 20 } 21 go = 0; 22 } 23 24 thread T {}; 25 void main( T & ) { 26 while ( go == 0 ) { yield(); } 20 27 BENCH( 21 for ( i; times ) { 22 wait(c); 23 }, 28 while ( go == 1 ) { call( m1, m2 ); }, 24 29 result 25 30 ) 26 31 printf( "%g\n", result ); 27 go = 0;28 return 0;29 }30 31 thread T {};32 void ^?{}( T & mutex this ) {}33 void main( T & ) {34 while(go == 0) { yield(); }35 while(go == 1) { call(m1, m2); }36 37 32 } 38 33 … … 40 35 BENCH_START() 41 36 T t; 42 return wait(m1, m2);37 wait( m1, m2 ); 43 38 } 44 39 -
benchmark/schedint/cfa4.cfa
r9e63a2b r2316525 7 7 8 8 volatile int go = 0; 9 condition c; 10 monitor M {} m1, m2, m3, m4; 9 11 10 condition c; 11 monitor M {}; 12 M m1, m2, m3, m4; 13 14 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) { 15 signal(c); 12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) { 13 signal( c ); 16 14 } 17 15 18 int __attribute__((noinline)) wait( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {16 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) { 19 17 go = 1; 18 for ( times ) { 19 wait( c ); 20 } 21 go = 0; 22 } 23 24 thread T {}; 25 void main( T & ) { 26 while ( go == 0 ) { yield(); } 20 27 BENCH( 21 for ( i; times ) { 22 wait(c); 23 }, 28 while ( go == 1 ) { call( m1, m2, m3, m4 ); }, 24 29 result 25 30 ) 26 31 printf( "%g\n", result ); 27 go = 0;28 return 0;29 }30 31 thread T {};32 void ^?{}( T & mutex this ) {}33 void main( T & ) {34 while(go == 0) { yield(); }35 while(go == 1) { call(m1, m2, m3, m4); }36 37 32 } 38 33 … … 40 35 BENCH_START() 41 36 T t; 42 return wait(m1, m2, m3, m4);37 wait( m1, m2, m3, m4 ); 43 38 } 44 39
Note: See TracChangeset
for help on using the changeset viewer.