Changeset 69e398f


Ignore:
Timestamp:
Jan 22, 2020, 10:07:35 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
8b16980
Parents:
9d6317f
Message:

interchange CFA coroutine and generator creation benchmarks

Location:
benchmark/creation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • benchmark/creation/cfa_cor.cfa

    r9d6317f r69e398f  
     1#include <stdio.h>
     2#include <coroutine.hfa>
     3
    14#include "bench.h"
    25
    3 typedef struct {
    4         void * next;
    5 } C;
     6coroutine MyCoroutine {};
     7void ?{}( MyCoroutine & this ) {
     8#ifdef EAGER
     9        resume( this );
     10#endif
     11}
     12void main( MyCoroutine & ) {}
    613
    714int main( int argc, char * argv[] ) {
     
    916        BENCH(
    1017                for ( times ) {
    11                         C c;
     18                        MyCoroutine c;
    1219                },
    1320                result
  • benchmark/creation/cfa_gen.cfa

    r9d6317f r69e398f  
    1 #include <stdio.h>
    2 #include <coroutine.hfa>
    3 
    41#include "bench.h"
    52
    6 coroutine MyCoroutine {};
    7 void ?{}( MyCoroutine & this ) {
    8 #ifdef EAGER
    9         resume( this );
    10 #endif
    11 }
    12 void main( MyCoroutine & ) {}
     3struct C {
     4        volatile int restart; // ensure compiler does not optimize away all the code
     5};
     6void ?{}( C & c ) { c.restart = 0; }
     7void main( C & ) {}
    138
    149int main( int argc, char * argv[] ) {
     
    1611        BENCH(
    1712                for ( times ) {
    18                         MyCoroutine c;
     13                         C c;
    1914                },
    2015                result
Note: See TracChangeset for help on using the changeset viewer.