Changes in / [f090750:96f5b30]


Ignore:
Location:
benchmark
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • benchmark/Makefile.am

    rf090750 r96f5b30  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Sun Jan 19 12:55:02 2020
    14 ## Update Count     : 232
     13## Last Modified On : Fri Jan 10 11:29:52 2020
     14## Update Count     : 230
    1515###############################################################################
    1616
     
    8383basic_loop_DURATION = 15000000000
    8484basic_function_DURATION = 10000000000
    85 basic_tls_fetch_add_DURATION = 10000000000
    8685basic_DURATION = 250000000
    8786
     
    292291ctxswitch-nodejs_coroutine$(EXEEXT):
    293292        echo "#!/bin/sh" > a.out
    294         echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out
     293        echo "node $(srcdir)/ctxswitch/node_cor.js" >> a.out
    295294        chmod a+x a.out
    296295
     
    435434creation-nodejs_coroutine$(EXEEXT):
    436435        echo "#!/bin/sh" > a.out
    437         echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out
     436        echo "node $(srcdir)/creation/node_cor.js" >> a.out
    438437        chmod a+x a.out
    439438
  • benchmark/Makefile.in

    rf090750 r96f5b30  
    421421basic_loop_DURATION = 15000000000
    422422basic_function_DURATION = 10000000000
    423 basic_tls_fetch_add_DURATION = 10000000000
    424423basic_DURATION = 250000000
    425424ctxswitch_pthread_DURATION = 25000000
     
    934933ctxswitch-nodejs_coroutine$(EXEEXT):
    935934        echo "#!/bin/sh" > a.out
    936         echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out
     935        echo "node $(srcdir)/ctxswitch/node_cor.js" >> a.out
    937936        chmod a+x a.out
    938937
     
    10691068creation-nodejs_coroutine$(EXEEXT):
    10701069        echo "#!/bin/sh" > a.out
    1071         echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out
     1070        echo "node $(srcdir)/creation/node_cor.js" >> a.out
    10721071        chmod a+x a.out
    10731072
  • benchmark/creation/cfa_cor.cfa

    rf090750 r96f5b30  
    55
    66coroutine MyCoroutine {};
    7 void ?{}( MyCoroutine & this ) {
     7void ?{} (MyCoroutine & this) {
    88#ifdef EAGER
    9         resume( this );
     9        resume(this);
    1010#endif
    1111}
    12 void main( MyCoroutine & ) {}
     12void main(MyCoroutine &) {}
    1313
    1414int main( int argc, char * argv[] ) {
    1515        BENCH_START()
    1616        BENCH(
    17                 for ( times ) {
    18                         MyCoroutine c;
     17                for ( i; times ) {
     18                        MyCoroutine m;
    1919                },
    2020                result
  • benchmark/creation/cfa_thrd.cfa

    rf090750 r96f5b30  
    1010        BENCH_START()
    1111        BENCH(
    12                 for ( times ) {
     12                for ( i; times ) {
    1313                        MyThread m;
    1414                },
  • benchmark/creation/node_cor.js

    rf090750 r96f5b30  
    44if ( argc == 3 ) times = Number( process.argv[2] )
    55
    6 function * coroutine() {}
     6function * coroutine() {
     7}
    78var hrstart = process.hrtime()
    89for ( var i = 0; i < times; i += 1 ) {
  • benchmark/ctxswitch/cfa_cor.cfa

    rf090750 r96f5b30  
    44#include "bench.h"
    55
    6 coroutine C {} c;
    7 void main( __attribute__((unused)) C & ) {
    8         while () {
     6coroutine GreatSuspender {};
     7void main( __attribute__((unused)) GreatSuspender & this ) {
     8        while ( true ) {
    99                suspend();
    1010        }
     
    1212int main( int argc, char * argv[] ) {
    1313        BENCH_START()
     14        GreatSuspender s;
    1415        BENCH(
    15                 for ( times ) {
    16                         resume( c );
     16                for ( i; times ) {
     17                        resume( s );
    1718                },
    1819                result
  • benchmark/ctxswitch/cfa_cor_then.cfa

    rf090750 r96f5b30  
    66void noOp(void) {}
    77
    8 coroutine C {} c;
     8coroutine GreatSuspender {};
    99
    10 void ?{}( C & this ) {
     10void ?{}( GreatSuspender & this ) {
    1111        prime(this);
    1212}
    1313
    14 void main( __attribute__((unused)) C & this ) {
    15         while () {
     14void main( __attribute__((unused)) GreatSuspender & this ) {
     15        while( true ) {
    1616                suspend_then(noOp);
    1717        }
     
    2020int main( int argc, char * argv[] ) {
    2121        BENCH_START()
     22        GreatSuspender s;
    2223        BENCH(
    23                 for ( times ) {
    24                         resume( c );
     24                for ( i; times ) {
     25                        resume( s );
    2526                },
    2627                result
  • benchmark/ctxswitch/cfa_gen.cfa

    rf090750 r96f5b30  
    33typedef struct {
    44        void * next;
    5 } C;
     5} GreatSuspender;
    66
    7 void comain( C * c ) {
    8         if ( __builtin_expect(c->next != 0, 1) ) goto *(c->next);
    9         c->next = &&s1;
     7void comain( GreatSuspender * this ) {
     8        if ( __builtin_expect(this->next != 0, 1) ) goto *(this->next);
     9        this->next = &&s1;
    1010        for () {
    1111                return;
     
    1616int main( int argc, char * argv[] ) {
    1717        BENCH_START()
    18         C c = { 0 };
     18        GreatSuspender s = { 0 };
    1919        BENCH(
    20                 for ( times ) {
    21                         comain( &c );
     20                for ( i; times ) {
     21                        comain( &s );
    2222                },
    2323                result
  • benchmark/ctxswitch/cfa_thrd.cfa

    rf090750 r96f5b30  
    66        BENCH_START()
    77        BENCH(
    8                 for ( times ) {
     8                for ( i; times ) {
    99                        yield();
    1010                },
  • benchmark/ctxswitch/cfa_thrd2.cfa

    rf090750 r96f5b30  
    88
    99void main(__attribute__((unused)) Fibre & this) {
    10         while ( ! done ) {
     10        while(!done) {
    1111                yield();
    1212        }
     
    1717        Fibre f1;
    1818        BENCH(
    19                 for ( times ) {
     19                for ( i; times ) {
    2020                        yield();
    2121                },
  • benchmark/ctxswitch/python_cor.py

    rf090750 r96f5b30  
    99        times = int( sys.argv[1] )
    1010
    11 def C():
     11def GreatSuspender():
    1212        while True:
    1313                yield
    1414
    15 c = C()
     15s = GreatSuspender()
    1616
    1717start = time.time_ns()
    1818for i in range( 10000000 ):
    19         next( c )  # resume
     19        next( s )  # resume
    2020end = time.time_ns()
    2121print( (end - start) / times )
  • benchmark/ctxswitch/upp_cor.cc

    rf090750 r96f5b30  
    33#include "bench.h"
    44
    5 _Coroutine C {
     5_Coroutine GreatSuspender {
    66        void main() {
    77                while( true ) {
     
    1313                resume();
    1414        }
    15 } c;
     15};
    1616int main( int argc, char * argv[] ) {
    1717        BENCH_START()
     18        GreatSuspender s;
    1819        BENCH(
    1920                for (size_t i = 0; i < times; i++) {
    20                         c.do_resume();
     21                        s.do_resume();
    2122                },
    2223                result
  • benchmark/mutex/cfa1.cfa

    rf090750 r96f5b30  
    44#include "bench.h"
    55
    6 monitor M {} m1;
    7 void __attribute__((noinline)) call( M & mutex p1 ) {}
     6monitor M {};
     7void __attribute__((noinline)) call( M & mutex m ) {}
    88
    99int main( int argc, char * argv[] ) {
    1010        BENCH_START()
     11        M m;
    1112        BENCH(
    12                 for ( times ) {
    13                         call( m1 );
     13                for ( i; times ) {
     14                        call( m );
    1415                },
    1516                result
  • benchmark/mutex/cfa2.cfa

    rf090750 r96f5b30  
    44#include "bench.h"
    55
    6 monitor M {} m1, m2;
    7 
    8 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {}
     6monitor M {};
     7void __attribute__((noinline)) call( M & mutex m1, M & mutex m2 ) {}
    98
    109int main( int argc, char * argv[] ) {
    1110        BENCH_START()
     11        M m1, m2;
    1212        BENCH(
    13                 for ( times ) {
     13                for ( i; times ) {
    1414                        call( m1, m2 );
    1515                },
  • benchmark/mutex/cfa4.cfa

    rf090750 r96f5b30  
    55
    66
    7 monitor M {} m1, m2, m3, m4;
    8 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {}
     7monitor M {};
     8void __attribute__((noinline)) call( M & mutex m1, M & mutex m2, M & mutex m3, M & mutex m4 ) {}
    99
    1010int main( int argc, char * argv[] ) {
    1111        BENCH_START()
     12        M m1, m2, m3, m4;
    1213        BENCH(
    13                 for ( times ) {
     14                for ( i; times ) {
    1415                        call( m1, m2, m3, m4 );
    1516                },
  • benchmark/mutexC/cfa1.cfa

    rf090750 r96f5b30  
    1111void call() {
    1212        go = true;
    13         for ( times ) {
     13        for ( i; times ) {
    1414                call( m );
    1515        }
  • benchmark/mutexC/cfa2.cfa

    rf090750 r96f5b30  
    1111void call() {
    1212        go = true;
    13         for ( times ) {
     13        for ( i; times ) {
    1414                call( m1, m2 );
    1515        }
  • benchmark/mutexC/cfa4.cfa

    rf090750 r96f5b30  
    1111void call() {
    1212        go = true;
    13         for ( times ) {
     13        for ( i; times ) {
    1414                call( m1, m2, m3, m4 );
    1515        }
  • benchmark/schedext/cfa1.cfa

    rf090750 r96f5b30  
    44#include <stdio.h>
    55
    6 #include "../bench.h"
     6#include "bench.h"
    77
    88volatile int go = 0;
    99
    10 monitor M {} m1;
     10monitor M {};
     11M m1;
    1112
    12 void __attribute__((noinline)) call( M & mutex p1 ) {}
     13void __attribute__((noinline)) call( M & mutex a1 ) {}
    1314
    14 void __attribute__((noinline)) wait( M & mutex p1 ) {
     15int  __attribute__((noinline)) wait( M & mutex a1 ) {
    1516        go = 1;
    16         for ( times ) {
    17                 waitfor( call : p1 );
     17        for ( i; times ) {
     18                waitfor(call : a1);
    1819        }
    1920        go = 0;
     21        return 0;
    2022}
    2123
    2224thread T {};
     25void ^?{}( T & mutex this ) {}
    2326void main( T & ) {
    24         while ( go == 0 ) { yield(); }
     27        while(go == 0) { yield(); }
    2528        BENCH(
    26                 while ( go == 1 ) { call( m1 ); },
     29                while(go == 1) { call(m1); },
    2730                result
    2831        )
     
    3336        BENCH_START()
    3437        T t;
    35         wait( m1 );
     38        return wait( m1 );
    3639}
    3740
  • benchmark/schedext/cfa2.cfa

    rf090750 r96f5b30  
    88volatile int go = 0;
    99
    10 monitor M {} m1, m2;
     10monitor M {};
     11M m1, m2;
    1112
    12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {}
     13void __attribute__((noinline)) call( M & mutex a1, M & mutex a2 ) {}
    1314
    14 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) {
     15int  __attribute__((noinline)) wait( M & mutex a1, M & mutex a2 ) {
    1516        go = 1;
    16         for ( times ) {
    17                 waitfor( call : p1, p2 );
     17        for ( i; times ) {
     18                waitfor(call : a1, a2);
    1819        }
    1920        go = 0;
     21        return 0;
    2022}
    2123
    2224thread T {};
     25void ^?{}( T & mutex this ) {}
    2326void main( T & ) {
    24         while( go == 0 ) { yield(); }
     27        while(go == 0) { yield(); }
    2528        BENCH(
    26                 while ( go == 1 ) { call( m1, m2 ); },
     29                while(go == 1) { call(m1, m2); },
    2730                result
    2831        )
     
    3336        BENCH_START()
    3437        T t;
    35         wait( m1, m2 );
     38        return wait( m1, m2 );
    3639}
    3740
  • benchmark/schedext/cfa4.cfa

    rf090750 r96f5b30  
    88volatile int go = 0;
    99
    10 monitor M {} m1, m2, m3, m4;
     10monitor M {};
     11M m1, m2, m3, m4;
    1112
    12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {}
     13void __attribute__((noinline)) call( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {}
    1314
    14 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {
     15int  __attribute__((noinline)) wait( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {
    1516        go = 1;
    16         for ( times ) {
    17                 waitfor( call : p1, p2, p3, p4 );
     17        for ( i; times ) {
     18                waitfor( call : a1, a2, a3, a4 );
    1819        }
    1920        go = 0;
     21        return 0;
    2022}
    2123
    2224thread T {};
     25void ^?{}( T & mutex this ) {}
    2326void main( T & ) {
    24         while( go == 0 ) { yield(); }
     27        while(go == 0) { yield(); }
    2528        BENCH(
    26                 while( go == 1 ) { call( m1, m2, m3, m4 ); },
     29                while(go == 1) { call(m1, m2, m3, m4); },
    2730                result
    2831        )
     
    3336        BENCH_START()
    3437        T t;
    35         wait( m1, m2, m3, m4 );
     38        return wait( m1, m2, m3, m4 );
    3639}
    3740
  • benchmark/schedext/upp.cc

    rf090750 r96f5b30  
    1111        int __attribute__((noinline)) wait() {
    1212                go = 1;
    13                 for ( size_t i = 0; i < times; i++ ) {
     13                for (size_t i = 0; i < times; i++) {
    1414                        _Accept(call);
    1515                }
     
    1717                return 0;
    1818        }
    19 } m;
     19};
     20
     21M m;
    2022
    2123_Task T {
    2224        void main() {
    23                 while ( go == 0 ) { yield(); }
     25                while(go == 0) { yield(); }
    2426                BENCH(
    25                         while ( go == 1 ) { m.call(); },
     27                        while(go == 1) { m.call(); },
    2628                        result
    2729                )
  • benchmark/schedint/cfa1.cfa

    rf090750 r96f5b30  
    44#include <stdio.h>
    55
    6 #include "../bench.h"
     6#include "bench.h"
    77
    88volatile int go = 0;
     9
    910condition c;
    10 monitor M {} m1;
     11monitor M {};
     12M m1;
    1113
    12 void __attribute__((noinline)) call( M & mutex p1 ) {
    13         signal( c );
     14void __attribute__((noinline)) call( M & mutex a1 ) {
     15        signal(c);
    1416}
    1517
    16 void __attribute__((noinline)) wait( M & mutex p1 ) {
     18int  __attribute__((noinline)) wait( M & mutex a1 ) {
    1719        go = 1;
    18         for ( times ) {
    19                 wait( c );
    20         }
     20        BENCH(
     21                for ( i; times ) {
     22                        wait(c);
     23                },
     24                result
     25        )
     26        printf( "%g\n", result );
    2127        go = 0;
     28        return 0;
    2229}
    2330
    2431thread T {};
     32void ^?{}( T & mutex ) {}
    2533void main( T & ) {
    26         while ( go == 0 ) { yield(); }
    27         BENCH(
    28                 while ( go == 1 ) { call( m1 ); },
    29                 result
    30         )
    31         printf( "%g\n", result );
     34        while(go == 0) { yield(); }
     35        while(go == 1) { call(m1); }
     36
    3237}
    3338
     
    3540        BENCH_START()
    3641        T t;
    37         wait( m1 );
     42        return wait(m1);
    3843}
    3944
  • benchmark/schedint/cfa2.cfa

    rf090750 r96f5b30  
    44#include <stdio.h>
    55
    6 #include "../bench.h"
     6#include "bench.h"
    77
    88volatile int go = 0;
     9
    910condition c;
    10 monitor M {} m1, m2;
     11monitor M {};
     12M m1, m2;
    1113
    12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {
    13         signal( c );
     14void __attribute__((noinline)) call( M & mutex a1, M & mutex a2 ) {
     15        signal(c);
    1416}
    1517
    16 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) {
     18int  __attribute__((noinline)) wait( M & mutex a1, M & mutex a2 ) {
    1719        go = 1;
    18         for ( times ) {
    19                 wait( c );
    20         }
     20        BENCH(
     21                for ( i; times ) {
     22                        wait(c);
     23                },
     24                result
     25        )
     26        printf( "%g\n", result );
    2127        go = 0;
     28        return 0;
    2229}
    2330
    2431thread T {};
     32void ^?{}( T & mutex this ) {}
    2533void main( T & ) {
    26         while ( go == 0 ) { yield(); }
    27         BENCH(
    28                 while ( go == 1 ) { call( m1, m2 ); },
    29                 result
    30         )
    31         printf( "%g\n", result );
     34        while(go == 0) { yield(); }
     35        while(go == 1) { call(m1, m2); }
     36
    3237}
    3338
     
    3540        BENCH_START()
    3641        T t;
    37         wait( m1, m2 );
     42        return wait(m1, m2);
    3843}
    3944
  • benchmark/schedint/cfa4.cfa

    rf090750 r96f5b30  
    77
    88volatile int go = 0;
     9
    910condition c;
    10 monitor M {} m1, m2, m3, m4;
     11monitor M {};
     12M m1, m2, m3, m4;
    1113
    12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {
    13         signal( c );
     14void __attribute__((noinline)) call( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {
     15        signal(c);
    1416}
    1517
    16 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {
     18int  __attribute__((noinline)) wait( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {
    1719        go = 1;
    18         for ( times ) {
    19                 wait( c );
    20         }
     20        BENCH(
     21                for ( i; times ) {
     22                        wait(c);
     23                },
     24                result
     25        )
     26        printf( "%g\n", result );
    2127        go = 0;
     28        return 0;
    2229}
    2330
    2431thread T {};
     32void ^?{}( T & mutex this ) {}
    2533void main( T & ) {
    26         while ( go == 0 ) { yield(); }
    27         BENCH(
    28                 while ( go == 1 ) { call( m1, m2, m3, m4 ); },
    29                 result
    30         )
    31         printf( "%g\n", result );
     34        while(go == 0) { yield(); }
     35        while(go == 1) { call(m1, m2, m3, m4); }
     36
    3237}
    3338
     
    3540        BENCH_START()
    3641        T t;
    37         wait( m1, m2, m3, m4 );
     42        return wait(m1, m2, m3, m4);
    3843}
    3944
Note: See TracChangeset for help on using the changeset viewer.