Changeset 7030dab for benchmark


Ignore:
Timestamp:
Apr 6, 2020, 4:46:28 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
Children:
e3bc51c
Parents:
71d6bd8 (diff), 057298e (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.
Message:

Merge branch 'master' into new-ast

Location:
benchmark
Files:
24 added
3 deleted
38 edited
4 moved

Legend:

Unmodified
Added
Removed
  • benchmark/Makefile.am

    r71d6bd8 r7030dab  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Jul 29 18:02:19 2019
    14 ## Update Count     : 54
     13## Last Modified On : Tue Mar 10 11:41:18 2020
     14## Update Count     : 258
    1515###############################################################################
    1616
     
    2828BENCH_V_CFA = $(__bench_v_CFA_$(__quiet))
    2929BENCH_V_CXX = $(__bench_v_CXX_$(__quiet))
     30BENCH_V_UPP = $(__bench_v_UPP_$(__quiet))
    3031BENCH_V_GOC = $(__bench_v_GOC_$(__quiet))
     32BENCH_V_PY = $(__bench_v_PY_$(__quiet))
     33BENCH_V_RUSTC = $(__bench_v_RUSTC_$(__quiet))
     34BENCH_V_NODEJS = $(__bench_v_NODEJS_$(__quiet))
    3135BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet))
    32 BENCH_V_UPP = $(__bench_v_UPP_$(__quiet))
    3336
    3437__quiet = verbose
     
    3639__bench_v_CFA_quiet = @
    3740__bench_v_CXX_quiet = @
     41__bench_v_UPP_quiet = @
    3842__bench_v_GOC_quiet = @
     43__bench_v_RUSTC_quiet = @
    3944__bench_v_JAVAC_quiet = @
    40 __bench_v_UPP_quiet = @
    4145__bench_v_CC_verbose = $(AM_V_CC)
    4246__bench_v_CFA_verbose = $(AM_V_CFA)
    4347__bench_v_CXX_verbose = $(AM_V_CXX)
     48__bench_v_UPP_verbose = $(AM_V_UPP)
    4449__bench_v_GOC_verbose = $(AM_V_GOC)
     50__bench_v_PY_verbose = $(AM_V_PY)
     51__bench_v_RUSTC_verbose = $(AM_V_RUST)
     52__bench_v_NODEJS_verbose = $(AM_V_NODEJS)
    4553__bench_v_JAVAC_verbose = $(AM_V_JAVAC)
    46 __bench_v_UPP_verbose = $(AM_V_UPP)
    4754
    4855
     
    5158STATS    = ${abs_top_srcdir}/tools/stat.py
    5259# NEED AT LEAST 4 DATA VALUES FOR BENCHMARKS BECAUSE THE MAX AND MIN VALUES ARE REMOVED
    53 repeats  = 5 # 31 for benchmarks
     60repeats  = 13 # 31 for benchmarks
    5461arch     = x64
    5562skipcompile = no
     
    6269
    6370dummyC.c:
    64         @echo "int main() { return 0; }" > ${@}
     71        echo "int main() { return 0; }" > ${@}
    6572
    6673dummyCXX.cpp:
    67         @echo "int main() { return 0; }" > ${@}
    68 
     74        echo "int main() { return 0; }" > ${@}
     75
     76.SILENT:                # do not print recipe
    6977.NOTPARALLEL:
    70 .PHONY: compile.csv ctxswitch.csv mutex.csv signal.csv
    71 
    72 ## =========================================================================================================
    73 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)
     78.PHONY: jenkins cleancsv
     79
     80## =========================================================================================================
     81
     82all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) schedint$(EXEEXT) schedext$(EXEEXT) creation$(EXEEXT)
     83
     84basic_loop_DURATION = 15000000000
     85basic_function_DURATION = 10000000000
     86basic_tls_fetch_add_DURATION = 10000000000
     87basic_DURATION = 250000000
     88
     89ctxswitch_pthread_DURATION = 25000000
     90ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION)
     91ctxswitch_cfa_generator_DURATION = 5000000000
     92ctxswitch_nodejs_await_DURATION = 5000000
     93ctxswitch_DURATION = 100000000
     94
     95#mutex_java_DURATION = 10000000
     96mutex_DURATION = 50000000
     97
     98schedint_pthread_DURATION = 1000000
     99schedint_java_DURATION = $(schedint_pthread_DURATION)
     100schedint_rust_DURATION = $(schedint_pthread_DURATION)
     101schedint_DURATION = 10000000
     102
     103schedext_DURATION = 10000000
     104
     105creation_pthread_DURATION = 250000
     106creation_rust_thread_DURATION = ${creation_pthread_DURATION}
     107creation_java_thread_DURATION = ${creation_pthread_DURATION}
     108creation_cfa_coroutine_DURATION = 100000000
     109creation_cfa_coroutine_eager_DURATION = 10000000
     110creation_cfa_generator_DURATION = 1000000000
     111creation_upp_coroutine_DURATION = ${creation_cfa_coroutine_eager_DURATION}
     112creation_cfa_thread_DURATION = 10000000
     113creation_upp_thread_DURATION = ${creation_cfa_thread_DURATION}
     114creation_DURATION = 10000000
    74115
    75116%.run : %$(EXEEXT) ${REPEAT}
    76         @rm -f .result.log
    77         @echo "------------------------------------------------------"
    78         @echo $<
    79         @${REPEAT} ${repeats} ./a.out | tee -a .result.log
    80         @${STATS} .result.log
    81         @echo "------------------------------------------------------"
    82         @rm -f a.out .result.log *.class
     117        rm -f .result.log
     118        echo "------------------------------------------------------"
     119        echo $<
     120        ${REPEAT} ${repeats} -- ./a.out\
     121                $(if ${$(subst -,_,$(basename $@))_DURATION},\
     122                        ${$(subst -,_,$(basename $@))_DURATION},\
     123                        ${$(firstword $(subst -, ,$(basename $@)))_DURATION}) | tee -a .result.log
     124        ${STATS} .result.log
     125        echo "------------------------------------------------------"
     126        rm -f a.out .result.log *.class
     127
     128#       ${REPEAT} ${repeats} -- /usr/bin/time -f "%Uu %Ss %Er %Mkb" ./a.out
    83129
    84130%.runquiet :
    85         @+make $(basename $@) CFLAGS="-w" __quiet=quiet
    86         @taskset -c 1 ./a.out
    87         @rm -f a.out
     131        +make $(basename $@) CFLAGS="-w" __quiet=quiet
     132        taskset -c 1 ./a.out
     133        rm -f a.out
    88134
    89135%.make :
    90         @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@))
    91         @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1
     136        printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@))
     137        +/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1
    92138
    93139${REPEAT} :
    94         @+make -C ${abs_top_builddir}/tools repeat
     140        +make -C ${abs_top_builddir}/tools repeat
    95141
    96142## =========================================================================================================
     
    98144FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@
    99145
    100 jenkins$(EXEEXT):
     146cleancsv:
     147        rm -f compile.csv basic.csv ctxswitch.csv mutex.csv scheduling.csv
     148
     149jenkins$(EXEEXT): cleancsv
    101150@DOifskipcompile@
    102         @+make compile.csv
    103         @-+make compile.diff.csv
     151        +make compile.csv
     152        -+make compile.diff.csv
    104153@DOendif@
    105         @+make ctxswitch.csv
    106         @-+make ctxswitch.diff.csv
    107         @+make mutex.csv
    108         @-+make mutex.diff.csv
    109         @+make signal.csv
    110         @-+make signal.diff.csv
     154        +make ctxswitch.csv
     155        -+make ctxswitch.diff.csv
     156        +make mutex.csv
     157        -+make mutex.diff.csv
     158        +make scheduling.csv
     159        -+make scheduling.diff.csv
    111160@DOifskipcompile@
    112161        cat compile.csv
     
    117166        cat mutex.csv
    118167        -cat mutex.diff.csv
    119         cat signal.csv
    120         -cat signal.diff.csv
     168        cat scheduling.csv
     169        -cat scheduling.diff.csv
    121170
    122171compile.csv:
    123         @echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@
    124         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@
    125         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@
    126         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@
    127         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@
    128         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@
    129         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@
    130         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@
    131         @+make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@
    132         @$(srcdir)/fixcsv.sh $@
     172        echo "building $@"
     173        echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@
     174        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@
     175        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@
     176        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@
     177        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@
     178        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@
     179        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@
     180        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@
     181        +make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@
     182        $(srcdir)/fixcsv.sh $@
    133183
    134184ctxswitch.csv:
    135         @echo "generator,coroutine,thread" > $@
    136         @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
    137         @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
    138         @+make ctxswitch-cfa_thread.runquiet >> $@
    139         @$(srcdir)/fixcsv.sh $@
     185        echo "building $@"
     186        echo "generator,coroutine,thread" > $@
     187        +make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
     188        +make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
     189        +make ctxswitch-cfa_thread.runquiet >> $@
     190        $(srcdir)/fixcsv.sh $@
    140191
    141192mutex.csv:
    142         @echo "1-monitor,2-monitor" > $@
    143         @+make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@
    144         @+make mutex-cfa2.runquiet >> $@
    145         @$(srcdir)/fixcsv.sh $@
    146 
    147 signal.csv:
    148         @echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@
    149         @+make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@
    150         @+make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@
    151         @+make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@
    152         @+make waitfor-cfa2.runquiet >> $@
    153         @$(srcdir)/fixcsv.sh $@
     193        echo "building $@"
     194        echo "1-monitor,2-monitor" > $@
     195        +make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@
     196        +make mutex-cfa2.runquiet >> $@
     197        $(srcdir)/fixcsv.sh $@
     198
     199scheduling.csv:
     200        echo "building $@"
     201        echo "schedint-1,schedint-2,schedext-1,schedext-2" > $@
     202        +make schedint-cfa1.runquiet >> $@ && echo -n ',' >> $@
     203        +make schedint-cfa2.runquiet >> $@ && echo -n ',' >> $@
     204        +make schedext-cfa1.runquiet >> $@ && echo -n ',' >> $@
     205        +make schedext-cfa2.runquiet >> $@
     206        $(srcdir)/fixcsv.sh $@
    154207
    155208%.diff.csv: %.csv
    156         @test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false)
    157         @$(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@
    158 
    159 
    160 ## =========================================================================================================
    161 loop$(EXEEXT):
    162         $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c
    163 
    164 function$(EXEEXT):
    165         $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c
    166 
    167 fetch_add$(EXEEXT):
    168         $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
    169 
    170 ttst_lock$(EXEEXT):
    171         $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/ttst_lock.c
    172 
    173 tls-fetch_add$(EXEEXT):
    174         $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/tls-fetch_add.c
    175 
    176 ## =========================================================================================================
    177 CTXSWITCH_DEPEND  =                 \
    178         loop.run                                \
    179         function.run                    \
    180         fetch_add.run                   \
    181         ttst_lock.run                   \
    182         tls-fetch_add.run                       \
    183         ctxswitch-pthread.run           \
     209        test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false)
     210        $(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@
     211
     212## =========================================================================================================
     213
     214BASIC_DEPEND  =                                 \
     215        basic-loop.run                          \
     216        basic-function.run                      \
     217        basic-fetch_add.run                     \
     218        basic-ttst_lock.run                     \
     219        basic-tls-fetch_add.run
     220
     221basic-loop$(EXEEXT):
     222        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/loop.c
     223
     224basic-function$(EXEEXT):
     225        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/function.c
     226
     227basic-fetch_add$(EXEEXT):
     228        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/fetch_add.c
     229
     230basic-ttst_lock$(EXEEXT):
     231        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/ttst_lock.c
     232
     233basic-tls-fetch_add$(EXEEXT):
     234        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/tls_fetch_add.c
     235
     236basic$(EXEEXT): $(BASIC_DEPEND)
     237
     238## =========================================================================================================
     239
     240CTXSWITCH_DEPEND  =                     \
    184241        ctxswitch-cfa_generator.run     \
    185242        ctxswitch-cfa_coroutine.run     \
     
    188245        ctxswitch-upp_coroutine.run     \
    189246        ctxswitch-upp_thread.run        \
    190         ctxswitch-goroutine.run         \
    191         ctxswitch-java_thread.run
    192 
     247        ctxswitch-python_coroutine.run  \
     248        ctxswitch-nodejs_coroutine.run  \
     249        ctxswitch-nodejs_await.run      \
     250        ctxswitch-goroutine_thread.run  \
     251        ctxswitch-rust_thread.run       \
     252        ctxswitch-nodejs_coroutine.run  \
     253        ctxswitch-java_thread.run       \
     254        ctxswitch-pthread.run
    193255
    194256if WITH_LIBFIBRE
    195 CTXSWITCH_DEPEND  +=           \
    196         ctxswitch-kos_fibre.run  \
     257CTXSWITCH_DEPEND  +=                    \
     258        ctxswitch-kos_fibre.run         \
    197259        ctxswitch-kos_fibre2.run
    198 
    199260
    200261ctxswitch-kos_fibre$(EXEEXT):
     
    207268ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND)
    208269
    209 ctxswitch-pthread$(EXEEXT):
    210         $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c
    211 
    212270ctxswitch-cfa_generator$(EXEEXT):
    213         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_gen.cfa
     271        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_gen.cfa
    214272
    215273ctxswitch-cfa_coroutine$(EXEEXT):
    216         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa
     274        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_cor.cfa
    217275
    218276ctxswitch-cfa_thread$(EXEEXT):
    219         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa
     277        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd.cfa
    220278
    221279ctxswitch-cfa_thread2$(EXEEXT):
    222         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa
     280        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd2.cfa
    223281
    224282ctxswitch-upp_coroutine$(EXEEXT):
    225         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc
     283        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_cor.cc
    226284
    227285ctxswitch-upp_thread$(EXEEXT):
    228         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc
    229 
    230 ctxswitch-goroutine$(EXEEXT):
     286        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_thrd.cc
     287
     288ctxswitch-python_coroutine$(EXEEXT):
     289        $(BENCH_V_PY)echo "#!/bin/sh" > a.out
     290        echo "python3.7 $(srcdir)/ctxswitch/python_cor.py" >> a.out
     291        chmod a+x a.out
     292
     293ctxswitch-nodejs_coroutine$(EXEEXT):
     294        $(BENCH_V_NODEJS)echo "#!/bin/sh" > a.out
     295        echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out
     296        chmod a+x a.out
     297
     298ctxswitch-nodejs_await$(EXEEXT):
     299        $(BENCH_V_NODEJS)echo "#!/bin/sh" > a.out
     300        echo "nodejs $(srcdir)/ctxswitch/node_await.js" >> a.out
     301        chmod a+x a.out
     302
     303ctxswitch-goroutine_thread$(EXEEXT):
    231304        $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
     305
     306ctxswitch-rust_thread$(EXEEXT):
     307        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/ctxswitch/rust_thrd.rs
    232308
    233309ctxswitch-java_thread$(EXEEXT):
    234310        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
    235         @echo "#!/bin/sh" > a.out
    236         @echo "java JavaThread" >> a.out
    237         @chmod a+x a.out
    238 
    239 ## =========================================================================================================
    240 mutex$(EXEEXT) :\
    241         loop.run                        \
    242         function.run            \
    243         fetch_add.run           \
    244         mutex-pthread_lock.run  \
    245         mutex-upp.run           \
     311        echo "#!/bin/sh" > a.out
     312        echo "java JavaThread" >> a.out
     313        chmod a+x a.out
     314
     315ctxswitch-pthread$(EXEEXT):
     316        $(BENCH_V_CC)$(COMPILE) $(srcdir)/ctxswitch/pthreads.c
     317
     318## =========================================================================================================
     319
     320mutex$(EXEEXT) :                \
    246321        mutex-cfa1.run          \
    247322        mutex-cfa2.run          \
    248323        mutex-cfa4.run          \
    249         mutex-java_thread.run
    250 
    251 mutex-pthread_lock$(EXEEXT):
    252         $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c
     324        mutex-upp.run           \
     325        mutex-go.run            \
     326        mutex-rust.run          \
     327        mutex-java.run          \
     328        mutex-pthread.run
     329
     330mutex-pthread$(EXEEXT):
     331        $(BENCH_V_CC)$(COMPILE) $(srcdir)/mutex/pthreads.c
     332
     333mutex-cfa1$(EXEEXT):
     334        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa1.cfa
     335
     336mutex-cfa2$(EXEEXT):
     337        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa2.cfa
     338
     339mutex-cfa4$(EXEEXT):
     340        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa4.cfa
    253341
    254342mutex-upp$(EXEEXT):
    255         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc
    256 
    257 mutex-cfa1$(EXEEXT):
    258         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa1.cfa
    259 
    260 mutex-cfa2$(EXEEXT):
    261         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa2.cfa
    262 
    263 mutex-cfa4$(EXEEXT):
    264         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa4.cfa
    265 
    266 mutex-java_thread$(EXEEXT):
     343        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/mutex/upp.cc
     344
     345mutex-go$(EXEEXT):
     346        $(BENCH_V_GOC)go build -o a.out $(srcdir)/mutex/goroutine.go
     347
     348mutex-rust$(EXEEXT):
     349        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/mutex/rust.rs
     350
     351mutex-java$(EXEEXT):
    267352        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
    268         @echo "#!/bin/sh" > a.out
    269         @echo "java JavaThread" >> a.out
    270         @chmod a+x a.out
    271 
    272 ## =========================================================================================================
    273 signal$(EXEEXT) :\
    274         signal-pthread_cond.run \
    275         signal-upp.run          \
    276         signal-cfa1.run         \
    277         signal-cfa2.run         \
    278         signal-cfa4.run         \
    279         signal-java_thread.run
    280 
    281 signal-pthread_cond$(EXEEXT):
    282         $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=500000  $(srcdir)/schedint/pthreads.c
    283 
    284 signal-upp$(EXEEXT):
    285         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc
    286 
    287 signal-cfa1$(EXEEXT):
    288         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa1.cfa
    289 
    290 signal-cfa2$(EXEEXT):
    291         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa2.cfa
    292 
    293 signal-cfa4$(EXEEXT):
    294         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa4.cfa
    295 
    296 signal-java_thread$(EXEEXT):
     353        echo "#!/bin/sh" > a.out
     354        echo "java JavaThread" >> a.out
     355        chmod a+x a.out
     356
     357## =========================================================================================================
     358
     359schedint$(EXEEXT) :             \
     360        schedint-cfa1.run       \
     361        schedint-cfa2.run       \
     362        schedint-cfa4.run       \
     363        schedint-upp.run        \
     364        schedint-rust.run       \
     365        schedint-java.run       \
     366        schedint-pthread.run
     367
     368schedint-cfa1$(EXEEXT):
     369        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa
     370
     371schedint-cfa2$(EXEEXT):
     372        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa
     373
     374schedint-cfa4$(EXEEXT):
     375        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa
     376
     377schedint-upp$(EXEEXT):
     378        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc
     379
     380schedint-rust$(EXEEXT):
     381        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs
     382
     383schedint-java$(EXEEXT):
    297384        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
    298         @echo "#!/bin/sh" > a.out
    299         @echo "java JavaThread" >> a.out
    300         @chmod a+x a.out
    301 
    302 
    303 ## =========================================================================================================
    304 waitfor$(EXEEXT) :\
    305         waitfor-upp.run         \
    306         waitfor-cfa1.run                \
    307         waitfor-cfa2.run                \
    308         waitfor-cfa4.run
    309 
    310 waitfor-upp$(EXEEXT):
    311         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc
    312 
    313 waitfor-cfa1$(EXEEXT):
    314         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa1.cfa
    315 
    316 waitfor-cfa2$(EXEEXT):
    317         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa2.cfa
    318 
    319 waitfor-cfa4$(EXEEXT):
    320         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa4.cfa
    321 
    322 ## =========================================================================================================
    323 creation$(EXEEXT) :\
    324         creation-pthread.run                    \
     385        echo "#!/bin/sh" > a.out
     386        echo "java JavaThread" >> a.out
     387        chmod a+x a.out
     388
     389schedint-pthread$(EXEEXT):
     390        $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c
     391
     392## =========================================================================================================
     393
     394schedext$(EXEEXT) :             \
     395        schedext-cfa1.run       \
     396        schedext-cfa2.run       \
     397        schedext-cfa4.run       \
     398        schedext-upp.run        \
     399        schedext-goroutine.run
     400
     401schedext-cfa1$(EXEEXT):
     402        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa
     403
     404schedext-cfa2$(EXEEXT):
     405        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa
     406
     407schedext-cfa4$(EXEEXT):
     408        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa
     409
     410schedext-upp$(EXEEXT):
     411        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc
     412
     413schedext-goroutine$(EXEEXT):
     414        $(BENCH_V_GOC)go build -o a.out $(srcdir)/schedext/goroutine.go
     415
     416
     417## =========================================================================================================
     418
     419creation$(EXEEXT) :                             \
     420        creation-cfa_generator.run              \
    325421        creation-cfa_coroutine.run              \
    326422        creation-cfa_coroutine_eager.run        \
     
    328424        creation-upp_coroutine.run              \
    329425        creation-upp_thread.run                 \
    330         creation-goroutine.run                  \
    331         creation-java_thread.run
     426        creation-python_coroutine.run           \
     427        creation-nodejs_coroutine.run           \
     428        creation-goroutine_thread.run           \
     429        creation-rust_thread.run                \
     430        creation-java_thread.run                \
     431        creation-pthread.run
     432
     433creation-cfa_generator$(EXEEXT):
     434        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_gen.cfa
    332435
    333436creation-cfa_coroutine$(EXEEXT):
    334         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa
     437        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa
    335438
    336439creation-cfa_coroutine_eager$(EXEEXT):
    337         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa  -DEAGER
     440        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa  -DEAGER
    338441
    339442creation-cfa_thread$(EXEEXT):
    340         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa
     443        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_thrd.cfa
    341444
    342445creation-upp_coroutine$(EXEEXT):
    343         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc
     446        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_cor.cc
    344447
    345448creation-upp_thread$(EXEEXT):
    346         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc
    347 
    348 creation-pthread$(EXEEXT):
    349         $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=250000   $(srcdir)/creation/pthreads.c
    350 
    351 creation-goroutine$(EXEEXT):
     449        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_thrd.cc
     450
     451creation-python_coroutine$(EXEEXT):
     452        $(BENCH_V_PY)echo "#!/bin/sh" > a.out
     453        echo "python3.7 $(srcdir)/creation/python_cor.py" >> a.out
     454        chmod a+x a.out
     455
     456creation-nodejs_coroutine$(EXEEXT):
     457        $(BENCH_V_NODEJS)echo "#!/bin/sh" > a.out
     458        echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out
     459        chmod a+x a.out
     460
     461creation-goroutine_thread$(EXEEXT):
    352462        $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
     463
     464creation-rust_thread$(EXEEXT):
     465        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs
    353466
    354467creation-java_thread$(EXEEXT):
    355468        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
    356         @echo "#!/bin/sh" > a.out
    357         @echo "java JavaThread" >> a.out
    358         @chmod a+x a.out
    359 
    360 ## =========================================================================================================
    361 
    362 compile$(EXEEXT) :\
     469        echo "#!/bin/sh" > a.out
     470        echo "java JavaThread" >> a.out
     471        chmod a+x a.out
     472
     473creation-pthread$(EXEEXT):
     474        $(BENCH_V_CC)$(COMPILE) $(srcdir)/creation/pthreads.c
     475
     476## =========================================================================================================
     477
     478compile$(EXEEXT) :              \
    363479        compile-array.make      \
    364480        compile-attributes.make \
     
    370486        compile-typeof.make
    371487
    372 
    373488testdir = $(top_srcdir)/tests
    374489
    375490compile-array$(EXEEXT):
    376         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
     491        $(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
    377492
    378493compile-attributes$(EXEEXT):
    379         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
     494        $(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
    380495
    381496compile-empty$(EXEEXT):
    382         @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
     497        $(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
    383498
    384499compile-expression$(EXEEXT):
    385         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
     500        $(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
    386501
    387502compile-io$(EXEEXT):
    388         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
     503        $(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
    389504
    390505compile-monitor$(EXEEXT):
    391         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
     506        $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
    392507
    393508compile-operators$(EXEEXT):
    394         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
     509        $(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
    395510
    396511compile-thread$(EXEEXT):
    397         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
     512        $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
    398513
    399514compile-typeof$(EXEEXT):
    400         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
     515        $(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
     516
     517## =========================================================================================================
     518
     519size$(EXEEXT) : size-cfa.runquiet
     520
     521size-cfa$(EXEEXT):
     522        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/size/size.cfa
  • benchmark/Makefile.in

    r71d6bd8 r7030dab  
    9393EXTRA_PROGRAMS = dummy$(EXEEXT)
    9494@WITH_LIBFIBRE_TRUE@am__append_1 = \
    95 @WITH_LIBFIBRE_TRUE@    ctxswitch-kos_fibre.run  \
     95@WITH_LIBFIBRE_TRUE@    ctxswitch-kos_fibre.run         \
    9696@WITH_LIBFIBRE_TRUE@    ctxswitch-kos_fibre2.run
    9797
     
    352352LTCFACOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
    353353        $(LIBTOOLFLAGS) --mode=compile $(CFACC) $(DEFS) \
    354         $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(CFAFLAGS) \
    355         $(AM_CFLAGS) $(CFLAGS)
     354        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(AM_CFLAGS) $(CFAFLAGS) $(CFLAGS)
    356355
    357356AM_V_CFA = $(am__v_CFA_@AM_V@)
     
    359358am__v_CFA_0 = @echo "  CFA     " $@;
    360359am__v_CFA_1 =
    361 AM_V_JAVAC = $(am__v_JAVAC_@AM_V@)
    362 am__v_JAVAC_ = $(am__v_JAVAC_@AM_DEFAULT_V@)
    363 am__v_JAVAC_0 = @echo "  JAVAC   " $@;
    364 am__v_JAVAC_1 =
    365 AM_V_GOC = $(am__v_GOC_@AM_V@)
    366 am__v_GOC_ = $(am__v_GOC_@AM_DEFAULT_V@)
    367 am__v_GOC_0 = @echo "  GOC     " $@;
    368 am__v_GOC_1 =
    369360UPPCC = u++
    370361UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS)
     
    373364am__v_UPP_0 = @echo "  UPP     " $@;
    374365am__v_UPP_1 =
     366AM_V_GOC = $(am__v_GOC_@AM_V@)
     367am__v_GOC_ = $(am__v_GOC_@AM_DEFAULT_V@)
     368am__v_GOC_0 = @echo "  GOC     " $@;
     369am__v_GOC_1 =
     370AM_V_PY = $(am__v_PY_@AM_V@)
     371am__v_PY_ = $(am__v_PY_@AM_DEFAULT_V@)
     372am__v_PY_0 = @echo "  PYTHON  " $@;
     373am__v_PY_1 =
     374AM_V_RUST = $(am__v_RUST_@AM_V@)
     375am__v_RUST_ = $(am__v_RUST_@AM_DEFAULT_V@)
     376am__v_RUST_0 = @echo "  RUST    " $@;
     377am__v_RUST_1 =
     378AM_V_NODEJS = $(am__v_NODEJS_@AM_V@)
     379am__v_NODEJS_ = $(am__v_NODEJS_@AM_DEFAULT_V@)
     380am__v_NODEJS_0 = @echo "  NODEJS  " $@;
     381am__v_NODEJS_1 =
     382AM_V_JAVAC = $(am__v_JAVAC_@AM_V@)
     383am__v_JAVAC_ = $(am__v_JAVAC_@AM_DEFAULT_V@)
     384am__v_JAVAC_0 = @echo "  JAVAC   " $@;
     385am__v_JAVAC_1 =
    375386
    376387# applies to both programs
     
    381392BENCH_V_CFA = $(__bench_v_CFA_$(__quiet))
    382393BENCH_V_CXX = $(__bench_v_CXX_$(__quiet))
     394BENCH_V_UPP = $(__bench_v_UPP_$(__quiet))
    383395BENCH_V_GOC = $(__bench_v_GOC_$(__quiet))
     396BENCH_V_PY = $(__bench_v_PY_$(__quiet))
     397BENCH_V_RUSTC = $(__bench_v_RUSTC_$(__quiet))
     398BENCH_V_NODEJS = $(__bench_v_NODEJS_$(__quiet))
    384399BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet))
    385 BENCH_V_UPP = $(__bench_v_UPP_$(__quiet))
    386400__quiet = verbose
    387401__bench_v_CC_quiet = @
    388402__bench_v_CFA_quiet = @
    389403__bench_v_CXX_quiet = @
     404__bench_v_UPP_quiet = @
    390405__bench_v_GOC_quiet = @
     406__bench_v_RUSTC_quiet = @
    391407__bench_v_JAVAC_quiet = @
    392 __bench_v_UPP_quiet = @
    393408__bench_v_CC_verbose = $(AM_V_CC)
    394409__bench_v_CFA_verbose = $(AM_V_CFA)
    395410__bench_v_CXX_verbose = $(AM_V_CXX)
     411__bench_v_UPP_verbose = $(AM_V_UPP)
    396412__bench_v_GOC_verbose = $(AM_V_GOC)
     413__bench_v_PY_verbose = $(AM_V_PY)
     414__bench_v_RUSTC_verbose = $(AM_V_RUST)
     415__bench_v_NODEJS_verbose = $(AM_V_NODEJS)
    397416__bench_v_JAVAC_verbose = $(AM_V_JAVAC)
    398 __bench_v_UPP_verbose = $(AM_V_UPP)
    399417TOOLSDIR = ${abs_top_builddir}/tools/
    400418REPEAT = ${abs_top_builddir}/tools/repeat
    401419STATS = ${abs_top_srcdir}/tools/stat.py
    402420# NEED AT LEAST 4 DATA VALUES FOR BENCHMARKS BECAUSE THE MAX AND MIN VALUES ARE REMOVED
    403 repeats = 5 # 31 for benchmarks
     421repeats = 13 # 31 for benchmarks
    404422arch = x64
    405423skipcompile = no
     
    407425PRINT_FORMAT = %20s: #Comments needed for spacing
    408426dummy_SOURCES = dummyC.c dummyCXX.cpp
     427basic_loop_DURATION = 15000000000
     428basic_function_DURATION = 10000000000
     429basic_tls_fetch_add_DURATION = 10000000000
     430basic_DURATION = 250000000
     431ctxswitch_pthread_DURATION = 25000000
     432ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION)
     433ctxswitch_cfa_generator_DURATION = 5000000000
     434ctxswitch_nodejs_await_DURATION = 5000000
     435ctxswitch_DURATION = 100000000
     436
     437#mutex_java_DURATION = 10000000
     438mutex_DURATION = 50000000
     439schedint_pthread_DURATION = 1000000
     440schedint_java_DURATION = $(schedint_pthread_DURATION)
     441schedint_rust_DURATION = $(schedint_pthread_DURATION)
     442schedint_DURATION = 10000000
     443schedext_DURATION = 10000000
     444creation_pthread_DURATION = 250000
     445creation_rust_thread_DURATION = ${creation_pthread_DURATION}
     446creation_java_thread_DURATION = ${creation_pthread_DURATION}
     447creation_cfa_coroutine_DURATION = 100000000
     448creation_cfa_coroutine_eager_DURATION = 10000000
     449creation_cfa_generator_DURATION = 1000000000
     450creation_upp_coroutine_DURATION = ${creation_cfa_coroutine_eager_DURATION}
     451creation_cfa_thread_DURATION = 10000000
     452creation_upp_thread_DURATION = ${creation_cfa_thread_DURATION}
     453creation_DURATION = 10000000
    409454FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@
    410 CTXSWITCH_DEPEND = loop.run function.run fetch_add.run ttst_lock.run \
    411         tls-fetch_add.run ctxswitch-pthread.run \
    412         ctxswitch-cfa_generator.run ctxswitch-cfa_coroutine.run \
    413         ctxswitch-cfa_thread.run ctxswitch-cfa_thread2.run \
    414         ctxswitch-upp_coroutine.run ctxswitch-upp_thread.run \
    415         ctxswitch-goroutine.run ctxswitch-java_thread.run \
    416         $(am__append_1)
     455BASIC_DEPEND = \
     456        basic-loop.run                          \
     457        basic-function.run                      \
     458        basic-fetch_add.run                     \
     459        basic-ttst_lock.run                     \
     460        basic-tls-fetch_add.run
     461
     462CTXSWITCH_DEPEND = ctxswitch-cfa_generator.run \
     463        ctxswitch-cfa_coroutine.run ctxswitch-cfa_thread.run \
     464        ctxswitch-cfa_thread2.run ctxswitch-upp_coroutine.run \
     465        ctxswitch-upp_thread.run ctxswitch-python_coroutine.run \
     466        ctxswitch-nodejs_coroutine.run ctxswitch-nodejs_await.run \
     467        ctxswitch-goroutine_thread.run ctxswitch-rust_thread.run \
     468        ctxswitch-nodejs_coroutine.run ctxswitch-java_thread.run \
     469        ctxswitch-pthread.run $(am__append_1)
    417470testdir = $(top_srcdir)/tests
    418471all: all-am
     
    733786
    734787dummyC.c:
    735         @echo "int main() { return 0; }" > ${@}
     788        echo "int main() { return 0; }" > ${@}
    736789
    737790dummyCXX.cpp:
    738         @echo "int main() { return 0; }" > ${@}
    739 
     791        echo "int main() { return 0; }" > ${@}
     792
     793.SILENT:                # do not print recipe
    740794.NOTPARALLEL:
    741 .PHONY: compile.csv ctxswitch.csv mutex.csv signal.csv
    742 
    743 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)
     795.PHONY: jenkins cleancsv
     796
     797all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) schedint$(EXEEXT) schedext$(EXEEXT) creation$(EXEEXT)
    744798
    745799%.run : %$(EXEEXT) ${REPEAT}
    746         @rm -f .result.log
    747         @echo "------------------------------------------------------"
    748         @echo $<
    749         @${REPEAT} ${repeats} ./a.out | tee -a .result.log
    750         @${STATS} .result.log
    751         @echo "------------------------------------------------------"
    752         @rm -f a.out .result.log *.class
     800        rm -f .result.log
     801        echo "------------------------------------------------------"
     802        echo $<
     803        ${REPEAT} ${repeats} -- ./a.out\
     804                $(if ${$(subst -,_,$(basename $@))_DURATION},\
     805                        ${$(subst -,_,$(basename $@))_DURATION},\
     806                        ${$(firstword $(subst -, ,$(basename $@)))_DURATION}) | tee -a .result.log
     807        ${STATS} .result.log
     808        echo "------------------------------------------------------"
     809        rm -f a.out .result.log *.class
     810
     811#       ${REPEAT} ${repeats} -- /usr/bin/time -f "%Uu %Ss %Er %Mkb" ./a.out
    753812
    754813%.runquiet :
    755         @+make $(basename $@) CFLAGS="-w" __quiet=quiet
    756         @taskset -c 1 ./a.out
    757         @rm -f a.out
     814        +make $(basename $@) CFLAGS="-w" __quiet=quiet
     815        taskset -c 1 ./a.out
     816        rm -f a.out
    758817
    759818%.make :
    760         @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@))
    761         @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1
     819        printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@))
     820        +/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1
    762821
    763822${REPEAT} :
    764         @+make -C ${abs_top_builddir}/tools repeat
    765 
    766 jenkins$(EXEEXT):
     823        +make -C ${abs_top_builddir}/tools repeat
     824
     825cleancsv:
     826        rm -f compile.csv basic.csv ctxswitch.csv mutex.csv scheduling.csv
     827
     828jenkins$(EXEEXT): cleancsv
    767829@DOifskipcompile@
    768         @+make compile.csv
    769         @-+make compile.diff.csv
     830        +make compile.csv
     831        -+make compile.diff.csv
    770832@DOendif@
    771         @+make ctxswitch.csv
    772         @-+make ctxswitch.diff.csv
    773         @+make mutex.csv
    774         @-+make mutex.diff.csv
    775         @+make signal.csv
    776         @-+make signal.diff.csv
     833        +make ctxswitch.csv
     834        -+make ctxswitch.diff.csv
     835        +make mutex.csv
     836        -+make mutex.diff.csv
     837        +make scheduling.csv
     838        -+make scheduling.diff.csv
    777839@DOifskipcompile@
    778840        cat compile.csv
     
    783845        cat mutex.csv
    784846        -cat mutex.diff.csv
    785         cat signal.csv
    786         -cat signal.diff.csv
     847        cat scheduling.csv
     848        -cat scheduling.diff.csv
    787849
    788850compile.csv:
    789         @echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@
    790         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@
    791         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@
    792         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@
    793         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@
    794         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@
    795         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@
    796         @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@
    797         @+make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@
    798         @$(srcdir)/fixcsv.sh $@
     851        echo "building $@"
     852        echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@
     853        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@
     854        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@
     855        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@
     856        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@
     857        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@
     858        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@
     859        +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@
     860        +make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@
     861        $(srcdir)/fixcsv.sh $@
    799862
    800863ctxswitch.csv:
    801         @echo "generator,coroutine,thread" > $@
    802         @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
    803         @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
    804         @+make ctxswitch-cfa_thread.runquiet >> $@
    805         @$(srcdir)/fixcsv.sh $@
     864        echo "building $@"
     865        echo "generator,coroutine,thread" > $@
     866        +make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
     867        +make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
     868        +make ctxswitch-cfa_thread.runquiet >> $@
     869        $(srcdir)/fixcsv.sh $@
    806870
    807871mutex.csv:
    808         @echo "1-monitor,2-monitor" > $@
    809         @+make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@
    810         @+make mutex-cfa2.runquiet >> $@
    811         @$(srcdir)/fixcsv.sh $@
    812 
    813 signal.csv:
    814         @echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@
    815         @+make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@
    816         @+make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@
    817         @+make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@
    818         @+make waitfor-cfa2.runquiet >> $@
    819         @$(srcdir)/fixcsv.sh $@
     872        echo "building $@"
     873        echo "1-monitor,2-monitor" > $@
     874        +make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@
     875        +make mutex-cfa2.runquiet >> $@
     876        $(srcdir)/fixcsv.sh $@
     877
     878scheduling.csv:
     879        echo "building $@"
     880        echo "schedint-1,schedint-2,schedext-1,schedext-2" > $@
     881        +make schedint-cfa1.runquiet >> $@ && echo -n ',' >> $@
     882        +make schedint-cfa2.runquiet >> $@ && echo -n ',' >> $@
     883        +make schedext-cfa1.runquiet >> $@ && echo -n ',' >> $@
     884        +make schedext-cfa2.runquiet >> $@
     885        $(srcdir)/fixcsv.sh $@
    820886
    821887%.diff.csv: %.csv
    822         @test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false)
    823         @$(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@
    824 
    825 loop$(EXEEXT):
    826         $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c
    827 
    828 function$(EXEEXT):
    829         $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c
    830 
    831 fetch_add$(EXEEXT):
    832         $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
    833 
    834 ttst_lock$(EXEEXT):
    835         $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/ttst_lock.c
    836 
    837 tls-fetch_add$(EXEEXT):
    838         $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/tls-fetch_add.c
     888        test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false)
     889        $(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@
     890
     891basic-loop$(EXEEXT):
     892        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/loop.c
     893
     894basic-function$(EXEEXT):
     895        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/function.c
     896
     897basic-fetch_add$(EXEEXT):
     898        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/fetch_add.c
     899
     900basic-ttst_lock$(EXEEXT):
     901        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/ttst_lock.c
     902
     903basic-tls-fetch_add$(EXEEXT):
     904        $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/tls_fetch_add.c
     905
     906basic$(EXEEXT): $(BASIC_DEPEND)
    839907
    840908@WITH_LIBFIBRE_TRUE@ctxswitch-kos_fibre$(EXEEXT):
     
    846914ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND)
    847915
    848 ctxswitch-pthread$(EXEEXT):
    849         $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c
    850 
    851916ctxswitch-cfa_generator$(EXEEXT):
    852         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_gen.cfa
     917        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_gen.cfa
    853918
    854919ctxswitch-cfa_coroutine$(EXEEXT):
    855         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa
     920        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_cor.cfa
    856921
    857922ctxswitch-cfa_thread$(EXEEXT):
    858         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa
     923        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd.cfa
    859924
    860925ctxswitch-cfa_thread2$(EXEEXT):
    861         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa
     926        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd2.cfa
    862927
    863928ctxswitch-upp_coroutine$(EXEEXT):
    864         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc
     929        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_cor.cc
    865930
    866931ctxswitch-upp_thread$(EXEEXT):
    867         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc
    868 
    869 ctxswitch-goroutine$(EXEEXT):
     932        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_thrd.cc
     933
     934ctxswitch-python_coroutine$(EXEEXT):
     935        $(BENCH_V_PY)echo "#!/bin/sh" > a.out
     936        echo "python3.7 $(srcdir)/ctxswitch/python_cor.py" >> a.out
     937        chmod a+x a.out
     938
     939ctxswitch-nodejs_coroutine$(EXEEXT):
     940        $(BENCH_V_NODEJS)echo "#!/bin/sh" > a.out
     941        echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out
     942        chmod a+x a.out
     943
     944ctxswitch-nodejs_await$(EXEEXT):
     945        $(BENCH_V_NODEJS)echo "#!/bin/sh" > a.out
     946        echo "nodejs $(srcdir)/ctxswitch/node_await.js" >> a.out
     947        chmod a+x a.out
     948
     949ctxswitch-goroutine_thread$(EXEEXT):
    870950        $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go
     951
     952ctxswitch-rust_thread$(EXEEXT):
     953        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/ctxswitch/rust_thrd.rs
    871954
    872955ctxswitch-java_thread$(EXEEXT):
    873956        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java
    874         @echo "#!/bin/sh" > a.out
    875         @echo "java JavaThread" >> a.out
    876         @chmod a+x a.out
    877 
    878 mutex$(EXEEXT) :\
    879         loop.run                        \
    880         function.run            \
    881         fetch_add.run           \
    882         mutex-pthread_lock.run  \
    883         mutex-upp.run           \
     957        echo "#!/bin/sh" > a.out
     958        echo "java JavaThread" >> a.out
     959        chmod a+x a.out
     960
     961ctxswitch-pthread$(EXEEXT):
     962        $(BENCH_V_CC)$(COMPILE) $(srcdir)/ctxswitch/pthreads.c
     963
     964mutex$(EXEEXT) :                \
    884965        mutex-cfa1.run          \
    885966        mutex-cfa2.run          \
    886967        mutex-cfa4.run          \
    887         mutex-java_thread.run
    888 
    889 mutex-pthread_lock$(EXEEXT):
    890         $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c
     968        mutex-upp.run           \
     969        mutex-go.run            \
     970        mutex-rust.run          \
     971        mutex-java.run          \
     972        mutex-pthread.run
     973
     974mutex-pthread$(EXEEXT):
     975        $(BENCH_V_CC)$(COMPILE) $(srcdir)/mutex/pthreads.c
     976
     977mutex-cfa1$(EXEEXT):
     978        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa1.cfa
     979
     980mutex-cfa2$(EXEEXT):
     981        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa2.cfa
     982
     983mutex-cfa4$(EXEEXT):
     984        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa4.cfa
    891985
    892986mutex-upp$(EXEEXT):
    893         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc
    894 
    895 mutex-cfa1$(EXEEXT):
    896         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa1.cfa
    897 
    898 mutex-cfa2$(EXEEXT):
    899         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa2.cfa
    900 
    901 mutex-cfa4$(EXEEXT):
    902         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000  $(srcdir)/mutex/cfa4.cfa
    903 
    904 mutex-java_thread$(EXEEXT):
     987        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/mutex/upp.cc
     988
     989mutex-go$(EXEEXT):
     990        $(BENCH_V_GOC)go build -o a.out $(srcdir)/mutex/goroutine.go
     991
     992mutex-rust$(EXEEXT):
     993        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/mutex/rust.rs
     994
     995mutex-java$(EXEEXT):
    905996        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java
    906         @echo "#!/bin/sh" > a.out
    907         @echo "java JavaThread" >> a.out
    908         @chmod a+x a.out
    909 
    910 signal$(EXEEXT) :\
    911         signal-pthread_cond.run \
    912         signal-upp.run          \
    913         signal-cfa1.run         \
    914         signal-cfa2.run         \
    915         signal-cfa4.run         \
    916         signal-java_thread.run
    917 
    918 signal-pthread_cond$(EXEEXT):
    919         $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=500000  $(srcdir)/schedint/pthreads.c
    920 
    921 signal-upp$(EXEEXT):
    922         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc
    923 
    924 signal-cfa1$(EXEEXT):
    925         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa1.cfa
    926 
    927 signal-cfa2$(EXEEXT):
    928         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa2.cfa
    929 
    930 signal-cfa4$(EXEEXT):
    931         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedint/cfa4.cfa
    932 
    933 signal-java_thread$(EXEEXT):
     997        echo "#!/bin/sh" > a.out
     998        echo "java JavaThread" >> a.out
     999        chmod a+x a.out
     1000
     1001schedint$(EXEEXT) :             \
     1002        schedint-cfa1.run       \
     1003        schedint-cfa2.run       \
     1004        schedint-cfa4.run       \
     1005        schedint-upp.run        \
     1006        schedint-rust.run       \
     1007        schedint-java.run       \
     1008        schedint-pthread.run
     1009
     1010schedint-cfa1$(EXEEXT):
     1011        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa
     1012
     1013schedint-cfa2$(EXEEXT):
     1014        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa
     1015
     1016schedint-cfa4$(EXEEXT):
     1017        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa
     1018
     1019schedint-upp$(EXEEXT):
     1020        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc
     1021
     1022schedint-rust$(EXEEXT):
     1023        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs
     1024
     1025schedint-java$(EXEEXT):
    9341026        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
    935         @echo "#!/bin/sh" > a.out
    936         @echo "java JavaThread" >> a.out
    937         @chmod a+x a.out
    938 
    939 waitfor$(EXEEXT) :\
    940         waitfor-upp.run         \
    941         waitfor-cfa1.run                \
    942         waitfor-cfa2.run                \
    943         waitfor-cfa4.run
    944 
    945 waitfor-upp$(EXEEXT):
    946         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc
    947 
    948 waitfor-cfa1$(EXEEXT):
    949         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa1.cfa
    950 
    951 waitfor-cfa2$(EXEEXT):
    952         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa2.cfa
    953 
    954 waitfor-cfa4$(EXEEXT):
    955         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000  $(srcdir)/schedext/cfa4.cfa
    956 
    957 creation$(EXEEXT) :\
    958         creation-pthread.run                    \
     1027        echo "#!/bin/sh" > a.out
     1028        echo "java JavaThread" >> a.out
     1029        chmod a+x a.out
     1030
     1031schedint-pthread$(EXEEXT):
     1032        $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c
     1033
     1034schedext$(EXEEXT) :             \
     1035        schedext-cfa1.run       \
     1036        schedext-cfa2.run       \
     1037        schedext-cfa4.run       \
     1038        schedext-upp.run        \
     1039        schedext-goroutine.run
     1040
     1041schedext-cfa1$(EXEEXT):
     1042        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa
     1043
     1044schedext-cfa2$(EXEEXT):
     1045        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa
     1046
     1047schedext-cfa4$(EXEEXT):
     1048        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa
     1049
     1050schedext-upp$(EXEEXT):
     1051        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc
     1052
     1053schedext-goroutine$(EXEEXT):
     1054        $(BENCH_V_GOC)go build -o a.out $(srcdir)/schedext/goroutine.go
     1055
     1056creation$(EXEEXT) :                             \
     1057        creation-cfa_generator.run              \
    9591058        creation-cfa_coroutine.run              \
    9601059        creation-cfa_coroutine_eager.run        \
     
    9621061        creation-upp_coroutine.run              \
    9631062        creation-upp_thread.run                 \
    964         creation-goroutine.run                  \
    965         creation-java_thread.run
     1063        creation-python_coroutine.run           \
     1064        creation-nodejs_coroutine.run           \
     1065        creation-goroutine_thread.run           \
     1066        creation-rust_thread.run                \
     1067        creation-java_thread.run                \
     1068        creation-pthread.run
     1069
     1070creation-cfa_generator$(EXEEXT):
     1071        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_gen.cfa
    9661072
    9671073creation-cfa_coroutine$(EXEEXT):
    968         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa
     1074        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa
    9691075
    9701076creation-cfa_coroutine_eager$(EXEEXT):
    971         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa  -DEAGER
     1077        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa  -DEAGER
    9721078
    9731079creation-cfa_thread$(EXEEXT):
    974         $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa
     1080        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_thrd.cfa
    9751081
    9761082creation-upp_coroutine$(EXEEXT):
    977         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc
     1083        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_cor.cc
    9781084
    9791085creation-upp_thread$(EXEEXT):
    980         $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc
    981 
    982 creation-pthread$(EXEEXT):
    983         $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=250000   $(srcdir)/creation/pthreads.c
    984 
    985 creation-goroutine$(EXEEXT):
     1086        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_thrd.cc
     1087
     1088creation-python_coroutine$(EXEEXT):
     1089        $(BENCH_V_PY)echo "#!/bin/sh" > a.out
     1090        echo "python3.7 $(srcdir)/creation/python_cor.py" >> a.out
     1091        chmod a+x a.out
     1092
     1093creation-nodejs_coroutine$(EXEEXT):
     1094        $(BENCH_V_NODEJS)echo "#!/bin/sh" > a.out
     1095        echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out
     1096        chmod a+x a.out
     1097
     1098creation-goroutine_thread$(EXEEXT):
    9861099        $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go
     1100
     1101creation-rust_thread$(EXEEXT):
     1102        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs
    9871103
    9881104creation-java_thread$(EXEEXT):
    9891105        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
    990         @echo "#!/bin/sh" > a.out
    991         @echo "java JavaThread" >> a.out
    992         @chmod a+x a.out
    993 
    994 compile$(EXEEXT) :\
     1106        echo "#!/bin/sh" > a.out
     1107        echo "java JavaThread" >> a.out
     1108        chmod a+x a.out
     1109
     1110creation-pthread$(EXEEXT):
     1111        $(BENCH_V_CC)$(COMPILE) $(srcdir)/creation/pthreads.c
     1112
     1113compile$(EXEEXT) :              \
    9951114        compile-array.make      \
    9961115        compile-attributes.make \
     
    10031122
    10041123compile-array$(EXEEXT):
    1005         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
     1124        $(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa
    10061125
    10071126compile-attributes$(EXEEXT):
    1008         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
     1127        $(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa
    10091128
    10101129compile-empty$(EXEEXT):
    1011         @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
     1130        $(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa
    10121131
    10131132compile-expression$(EXEEXT):
    1014         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
     1133        $(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa
    10151134
    10161135compile-io$(EXEEXT):
    1017         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
     1136        $(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa
    10181137
    10191138compile-monitor$(EXEEXT):
    1020         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
     1139        $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa
    10211140
    10221141compile-operators$(EXEEXT):
    1023         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
     1142        $(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa
    10241143
    10251144compile-thread$(EXEEXT):
    1026         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
     1145        $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa
    10271146
    10281147compile-typeof$(EXEEXT):
    1029         @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
     1148        $(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
     1149
     1150size$(EXEEXT) : size-cfa.runquiet
     1151
     1152size-cfa$(EXEEXT):
     1153        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/size/size.cfa
    10301154
    10311155# Tell versions [3.59,3.63) of GNU make to not export all variables.
  • benchmark/baselines/x64/schedint.csv

    r71d6bd8 r7030dab  
    1 waitfor-2,signal-1,signal-2,waitfor-1
     1schedext-2,schedint-1,schedint-2,schedext-1
    22393.69606249999987,325.99158333333327,409.01025000000004,319.90975000000003
  • benchmark/baselines/x86/schedint.csv

    r71d6bd8 r7030dab  
    1 signal-2,waitfor-1,waitfor-2,signal-1
     1schedint-2,schedext-1,schedext-2,schedint-1
    22532.5297959183672,413.3084897959184,506.7579591836735,423.78826530612247
  • benchmark/basic/tls_fetch_add.c

    r71d6bd8 r7030dab  
    33
    44#include "bench.h"
     5
     6// Does not do a fetch & add. It mimics the cfa protocol to disable interrupts locally, by writing true or false to a
     7// thread_local Boolean. This means the entire protocol is just to "mov" instructions making it extremely cheap.
    58
    69#define thread_local _Thread_local
     
    1619}
    1720
    18 int main(int argc, char* argv[]) {
     21int main( int argc, char * argv[] ) {
     22        BENCH_START()
    1923        BENCH(
    20                 for (size_t i = 0; i < n; i++) {
     24                for (size_t i = 0; i < times; i++) {
    2125                        do_call();
    2226                },
    2327                result
    2428        )
     29        printf( "%g\n", result );
     30}
    2531
    26         printf("%g\n", result);
    27 }
     32// Local Variables: //
     33// tab-width: 4 //
     34// End: //
  • benchmark/basic/ttst_lock.c

    r71d6bd8 r7030dab  
    33
    44#include "bench.h"
     5
     6// Does a "lock xchg" on entry but a simple "mov" on exit => cheaper as 0 contention. While it has much more code, the
     7// bulk is never run.
    58
    69#define CALIGN __attribute__(( aligned (CACHE_ALIGN) ))
     
    3538}
    3639
    37 int main(int argc, char* argv[]) {
     40int main( int argc, char * argv[] ) {
     41        BENCH_START()
    3842        BENCH(
    39                 for (size_t i = 0; i < n; i++) {
     43                for (size_t i = 0; i < times; i++) {
    4044                        do_call();
    4145                },
    4246                result
    43                 )
    44 
    45                 printf("%g\n", result);
     47        )
     48        printf( "%g\n", result );
    4649}
    4750
  • benchmark/bench.h

    r71d6bd8 r7030dab  
    55#endif
    66        #include <stdlib.h>
    7         #include <unistd.h>                                     // sysconf
     7        #include <stdint.h>                             // uint64_t
     8        #include <unistd.h>                             // sysconf
    89#if ! defined(__cforall)
    910        #include <time.h>
     
    1516
    1617
    17 static inline unsigned long long int bench_time() {
    18     struct timespec ts;
    19     clock_gettime(
    20 #if defined( __linux__ )
    21          CLOCK_THREAD_CPUTIME_ID,
    22 #elif defined( __freebsd__ )
    23          CLOCK_PROF,
    24 #elif defined( __solaris__ )
    25          CLOCK_HIGHRES,
    26 #else
    27     #error uC++ : internal error, unsupported architecture
    28 #endif
    29          &ts );
    30     return 1000000000LL * ts.tv_sec + ts.tv_nsec;
    31 } // Time
     18static inline uint64_t bench_time() {
     19        struct timespec ts;
     20        clock_gettime( CLOCK_THREAD_CPUTIME_ID, &ts );
     21        return 1000000000LL * ts.tv_sec + ts.tv_nsec;
     22} // bench_time
    3223
    3324#ifndef BENCH_N
    34 #define BENCH_N 500 //10000000
     25#define BENCH_N 10000000
    3526#endif
    3627
     28size_t times = BENCH_N;
     29
     30#define BENCH_START()                           \
     31        if ( argc > 2 ) exit( EXIT_FAILURE );   \
     32        if ( argc == 2 ) {                      \
     33                times = atoi( argv[1] );        \
     34        }
     35
    3736#define BENCH(statement, output)                \
    38         size_t n = BENCH_N;                     \
    39         if( argc > 2 ) return 1;                \
    40         if( argc == 2 ) {                               \
    41                 n = atoi(argv[1]);              \
    42         }                                               \
    43         long long int StartTime, EndTime;       \
     37        uint64_t StartTime, EndTime;            \
    4438        StartTime = bench_time();               \
    45         statement;                                      \
     39        statement;                              \
    4640        EndTime = bench_time();                 \
    47         double output =         \
    48             (double)( EndTime - StartTime ) / n;
     41        double output = (double)( EndTime - StartTime ) / times;
     42
    4943
    5044#if defined(__cforall)
     
    5347}
    5448#endif
     49#if defined(__U_CPLUSPLUS__)
     50unsigned int uDefaultPreemption() {
     51        return 0;
     52}
     53#endif
  • benchmark/creation/JavaThread.java

    r71d6bd8 r7030dab  
    2626        static int x = 2;
    2727
    28         static private final int NoOfTimes = Integer.parseInt("10000") ;
     28        static private int times = Integer.parseInt("10000") ;
    2929
    3030        public static class MyThread extends Thread {
     
    3333        }
    3434        public static void helper() throws InterruptedException {
    35                 for(int i = 1; i <= NoOfTimes; i += 1) {
     35                for(int i = 1; i <= times; i += 1) {
    3636                        MyThread m = new MyThread();
    3737                        x = nextRandom( x );
     
    4444                helper();
    4545                long end = System.nanoTime();
    46                 System.out.println( (end - start) / NoOfTimes );
     46                System.out.println( (end - start) / times );
    4747        }
    4848        public static void main(String[] args) throws InterruptedException {
    49                 for (int n = Integer.parseInt("5"); --n >= 0 ; ) {
     49                if ( args.length > 2 ) System.exit( 1 );
     50                if ( args.length == 2 ) { times = Integer.parseInt(args[1]); }
     51
     52                for (int i = Integer.parseInt("5"); --i >= 0 ; ) {
    5053                        InnerMain();
    51                         Thread.sleep(2000);     // 2 seconds
     54                        Thread.sleep(2000);             // 2 seconds
    5255                        x = nextRandom(x);
    5356                }
     
    5558        }
    5659}
     60
     61// Local Variables: //
     62// tab-width: 4 //
     63// End: //
  • benchmark/creation/cfa_cor.cfa

    r71d6bd8 r7030dab  
    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
    14 int main(int argc, char* argv[]) {
     14int main( int argc, char * argv[] ) {
     15        BENCH_START()
    1516        BENCH(
    16                 for ( i; n ) {
    17                         MyCoroutine m;
     17                for ( times ) {
     18                        MyCoroutine c;
    1819                },
    1920                result
    2021        )
     22        printf( "%g\n", result );
     23}
    2124
    22         printf("%g\n", result);
    23 }
     25// Local Variables: //
     26// tab-width: 4 //
     27// End: //
  • benchmark/creation/cfa_thrd.cfa

    r71d6bd8 r7030dab  
    77void main(MyThread &) {}
    88
    9 int main(int argc, char* argv[]) {
     9int main( int argc, char * argv[] ) {
     10        BENCH_START()
    1011        BENCH(
    11                 for ( i; n ) {
     12                for ( times ) {
    1213                        MyThread m;
    1314                },
    1415                result
    1516        )
     17        printf( "%g\n", result );
     18}
    1619
    17         printf("%g\n", result);
    18 }
     20// Local Variables: //
     21// tab-width: 4 //
     22// End: //
  • benchmark/creation/goroutine.go

    r71d6bd8 r7030dab  
    22
    33import (
    4     "fmt"
    5     "time"
     4        "fmt"
     5        "time"
     6        "os"
     7        "strconv"
    68)
    79
     
    1719
    1820func main() {
    19         const NoOfTimes = 500000
     21        var times int = 10000000
     22        if len( os.Args ) > 2 { os.Exit( 1 ) }
     23        if len( os.Args ) == 2 { times, _ = strconv.Atoi(os.Args[1]) }
     24
    2025        start := time.Now()
    21         for i := 1; i <= NoOfTimes; i += 1 {
     26        for i := 1; i <= times; i += 1 {
    2227                go noop()               // creation
     28                <- shake                // wait for completion
    2329        }
    2430        end := time.Now()
    25         fmt.Printf("%d\n", end.Sub(start) / time.Duration(NoOfTimes))
    26         <- shake
     31        fmt.Printf( "%d\n", end.Sub(start) / time.Duration(times) )
    2732}
     33
     34// Local Variables: //
     35// tab-width: 4 //
     36// End: //
  • benchmark/creation/pthreads.c

    r71d6bd8 r7030dab  
    44#include "bench.h"
    55
    6 static void *foo(void *arg) {
     6static void * foo(void *arg) {
    77    return arg;
    88}
    99
    10 int main(int argc, char* argv[]) {
     10int main( int argc, char * argv[] ) {
     11        BENCH_START()
    1112        BENCH(
    12                 for (size_t i = 0; i < n; i++) {
     13                for (size_t i = 0; i < times; i++) {
    1314                        pthread_t thread;
    1415                        if (pthread_create(&thread, NULL, foo, NULL) < 0) {
     
    1617                                return 1;
    1718                        }
    18 
    1919                        if (pthread_join( thread, NULL) < 0) {
    2020                                perror( "failure" );
     
    2424                result
    2525        )
     26        printf( "%g\n", result );
     27}
    2628
    27         printf("%g\n", result);
    28 }
     29// Local Variables: //
     30// tab-width: 4 //
     31// End: //
  • benchmark/creation/upp_cor.cc

    r71d6bd8 r7030dab  
    55_Coroutine MyCor {
    66        void main() {}
     7  public:
     8        MyCor() { resume(); }
    79};
    810
    9 int main(int argc, char* argv[]) {
     11int main( int argc, char * argv[] ) {
     12        BENCH_START()
    1013        BENCH(
    11                 for (size_t i = 0; i < n; i++) {
     14                for (size_t i = 0; i < times; i++) {
    1215                        MyCor m;
    1316                },
    1417                result
    1518        )
     19        printf( "%g\n", result );
     20}
    1621
    17         printf("%g\n", result);
    18 }
     22// Local Variables: //
     23// tab-width: 4 //
     24// End: //
  • benchmark/creation/upp_thrd.cc

    r71d6bd8 r7030dab  
    77};
    88
    9 int main(int argc, char* argv[]) {
     9int main( int argc, char * argv[] ) {
     10        BENCH_START()
    1011        BENCH(
    11                 for (size_t i = 0; i < n; i++) {
     12                for (size_t i = 0; i < times; i++) {
    1213                        MyThread m;
    1314                },
    1415                result
    1516        )
     17        printf( "%g\n", result );
     18}
    1619
    17         printf("%g\n", result);
    18 }
     20// Local Variables: //
     21// tab-width: 4 //
     22// End: //
  • benchmark/ctxswitch/JavaThread.java

    r71d6bd8 r7030dab  
    2626        static int x = 2;
    2727
    28         static private final int NoOfTimes = Integer.parseInt("1000000") ;
     28        static private int times = Integer.parseInt("100000");
    2929
    3030        public static void helper() {
    31                 for(int i = 1; i <= NoOfTimes; i += 1) {
     31                for(int i = 1; i <= times; i += 1) {
    3232                        Thread.yield();
    3333                }
     
    3737                helper();
    3838                long end = System.nanoTime();
    39                 System.out.println( (end - start) / NoOfTimes );
     39                System.out.println( (end - start) / times );
    4040        }
    4141        public static void main(String[] args) throws InterruptedException {
    42                 for (int n = Integer.parseInt("5"); --n >= 0 ; ) {
     42                if ( args.length > 2 ) System.exit( 1 );
     43                if ( args.length == 2 ) { times = Integer.parseInt(args[1]); }
     44
     45                for (int i = Integer.parseInt("5"); --i >= 0 ; ) {
    4346                        InnerMain();
    44                         Thread.sleep(2000);     // 2 seconds
     47                        Thread.sleep(2000);     // 2 seconds
    4548                        x = nextRandom(x);
    4649                }
     
    4851        }
    4952}
     53
     54// Local Variables: //
     55// tab-width: 4 //
     56// End: //
  • benchmark/ctxswitch/cfa_cor.cfa

    r71d6bd8 r7030dab  
    22#include <thread.hfa>
    33
    4 #include "bench.h"
     4#include "../bench.h"
    55
    6 coroutine GreatSuspender {};
    7 
    8 void ?{}( GreatSuspender & this ) {
    9         prime(this);
    10 }
    11 
    12 void main( __attribute__((unused)) GreatSuspender & this ) {
    13         while( true ) {
    14                 suspend();
     6coroutine C {};
     7void main( __attribute__((unused)) C & ) {
     8        for () {
     9                suspend;
    1510        }
    1611}
    17 
    18 int main(int argc, char* argv[]) {
    19         GreatSuspender s;
    20 
     12int main( int argc, char * argv[] ) {
     13        C c;
     14        BENCH_START()
    2115        BENCH(
    22                 for ( i; n ) {
    23                         resume( s );
     16                for ( times ) {
     17                        resume( c );
    2418                },
    2519                result
    2620        )
     21        printf( "%g\n", result );
     22}
    2723
    28         printf("%g\n", result);
    29 }
     24// Local Variables: //
     25// tab-width: 4 //
     26// End: //
  • benchmark/ctxswitch/cfa_cor_then.cfa

    r71d6bd8 r7030dab  
    66void noOp(void) {}
    77
    8 coroutine GreatSuspender {};
     8coroutine C {} c;
    99
    10 void ?{}( GreatSuspender & this ) {
     10void ?{}( C & this ) {
    1111        prime(this);
    1212}
    1313
    14 void main( __attribute__((unused)) GreatSuspender & this ) {
    15         while( true ) {
     14void main( __attribute__((unused)) C & this ) {
     15        while () {
    1616                suspend_then(noOp);
    1717        }
    1818}
    1919
    20 int main(int argc, char* argv[]) {
    21         GreatSuspender s;
    22 
     20int main( int argc, char * argv[] ) {
     21        BENCH_START()
    2322        BENCH(
    24                 for ( i; n ) {
    25                         resume( s );
     23                for ( times ) {
     24                        resume( c );
    2625                },
    2726                result
    2827        )
     28        printf( "%g\n", result );
     29}
    2930
    30         printf("%g\n", result);
    31 }
     31// Local Variables: //
     32// tab-width: 4 //
     33// End: //
  • benchmark/ctxswitch/cfa_gen.cfa

    r71d6bd8 r7030dab  
    11#include "../bench.h"
    22
    3 typedef struct {
    4         void * next;
    5 } GreatSuspender;
    6 
    7 void comain( GreatSuspender * this ) {
    8     if ( __builtin_expect(this->next != 0, 1) ) goto *(this->next);
    9     this->next = &&s1;
     3generator G {};
     4void main( G & ) {
    105        for () {
    11             return;
    12           s1: ;
     6                suspend;
    137        }
    148}
    159
    16 int main(int argc, char* argv[]) {
    17     GreatSuspender s = { 0 };
    18 
     10int main( int argc, char * argv[] ) {
     11        G g;
     12        BENCH_START()
    1913        BENCH(
    20                 for ( i; n ) {
    21                         comain( &s );
     14                for ( times ) {
     15                        resume( g );
    2216                },
    2317                result
    2418        )
     19        printf( "%g\n", result );
     20}
    2521
    26         printf("%g\n", result);
    27 }
     22// Local Variables: //
     23// tab-width: 4 //
     24// End: //
  • benchmark/ctxswitch/cfa_thrd.cfa

    r71d6bd8 r7030dab  
    33#include "bench.h"
    44
    5 int main(int argc, char* argv[]) {
     5int main( int argc, char * argv[] ) {
     6        BENCH_START()
    67        BENCH(
    7                 for ( i; n ) {
     8                for ( times ) {
    89                        yield();
    910                },
    1011                result
    1112        )
     13        printf( "%g\n", result );
     14}
    1215
    13         printf("%g\n", result);
    14 }
     16// Local Variables: //
     17// tab-width: 4 //
     18// End: //
  • benchmark/ctxswitch/cfa_thrd2.cfa

    r71d6bd8 r7030dab  
    88
    99void main(__attribute__((unused)) Fibre & this) {
    10         while(!done) {
     10        while ( ! done ) {
    1111                yield();
    1212        }
    1313}
    1414
    15 int main(int argc, char* argv[]) {
     15int main( int argc, char * argv[] ) {
     16        BENCH_START()
    1617        Fibre f1;
    1718        BENCH(
    18                 for ( i; n ) {
     19                for ( times ) {
    1920                        yield();
    2021                },
    2122                result
    2223        )
     24        printf( "%g\n", result );
     25        done = true;
     26}
    2327
    24         printf("%g\n", result);
    25         done = true;
    26         return 0;
    27 }
     28// Local Variables: //
     29// tab-width: 4 //
     30// End: //
  • benchmark/ctxswitch/goroutine.go

    r71d6bd8 r7030dab  
    22
    33import (
    4     "fmt"
    5     "runtime"
    6     "time"
     4        "fmt"
     5        "time"
     6        "os"
     7        "strconv"
     8        "runtime"
    79)
    810
     
    2830
    2931func main() {
    30         const NoOfTimes = 10000000
    31         go ContextSwitch( NoOfTimes )           // context switch
     32        var times int = 10000000
     33        if len( os.Args ) > 2 { os.Exit( 1 ) }
     34        if len( os.Args ) == 2 { times, _ = strconv.Atoi(os.Args[1]) }
     35        go ContextSwitch( times )               // context switch
    3236        <- shake
    3337}
     38
     39// Local Variables: //
     40// tab-width: 4 //
     41// End: //
  • benchmark/ctxswitch/kos_fibre.cpp

    r71d6bd8 r7030dab  
    33#include "bench.h"
    44
    5 int main(int argc, char* argv[]) {
     5int main( int argc, char * argv[] ) {
     6        BENCH_START()
    67        BENCH(
    7                 for (size_t i = 0; i < n; i++) {
     8                for (size_t i = 0; i < times; i++) {
    89                        Fibre::yield();
    910                },
    1011                result
    1112        )
    12         printf("%g\n", result);
    13         return 0;
     13        printf( "%g\n", result );
    1414}
     15
     16// Local Variables: //
     17// tab-width: 4 //
     18// End: //
  • benchmark/ctxswitch/kos_fibre2.cpp

    r71d6bd8 r7030dab  
    1111}
    1212
    13 int main(int argc, char* argv[]) {
     13int main( int argc, char * argv[] ) {
     14        BENCH_START()
    1415        Fibre* f1 = (new Fibre)->run(f1main);
    1516        BENCH(
    16                 for (size_t i = 0; i < n; i++) {
     17                for (size_t i = 0; i < times; i++) {
    1718                        Fibre::yield();
    1819                },
    1920                result
    2021        )
    21         printf("%g\n", result);
     22        printf( "%g\n", result );
    2223        done = true;
    2324        Fibre::yield();
    2425        f1->join();
    25         return 0;
    2626}
     27
     28// Local Variables: //
     29// tab-width: 4 //
     30// End: //
  • benchmark/ctxswitch/pthreads.c

    r71d6bd8 r7030dab  
    66#include "bench.h"
    77
    8 int main(int argc, char* argv[]) {
     8int main( int argc, char * argv[] ) {
     9        BENCH_START()
    910        BENCH(
    10                 for (size_t i = 0; i < n; i++) {
     11                for (size_t i = 0; i < times; i++) {
    1112                        sched_yield();
    1213                },
    1314                result
    1415        )
    15 
    16         printf("%g\n", result);
     16        printf( "%g\n", result );
    1717}
  • benchmark/ctxswitch/upp_cor.cc

    r71d6bd8 r7030dab  
    33#include "bench.h"
    44
    5 _Coroutine GreatSuspender {
    6 public:
    7         GreatSuspender() {
    8                 resume();
    9         }
    10 
    11         void do_resume() {
    12                 resume();
    13         }
    14 private:
     5_Coroutine C {
    156        void main() {
    167                while( true ) {
     
    189                }
    1910        }
    20 };
    21 
    22 int main(int argc, char* argv[]) {
    23         GreatSuspender s;
    24 
     11  public:
     12        void do_resume() {
     13                resume();
     14        }
     15} c;
     16int main( int argc, char * argv[] ) {
     17        BENCH_START()
    2518        BENCH(
    26                 for (size_t i = 0; i < n; i++) {
    27                         s.do_resume();
     19                for (size_t i = 0; i < times; i++) {
     20                        c.do_resume();
    2821                },
    2922                result
    3023        )
     24        printf( "%g\n", result );
     25}
    3126
    32         printf("%g\n", result);
    33 }
     27// Local Variables: //
     28// tab-width: 4 //
     29// End: //
  • benchmark/ctxswitch/upp_thrd.cc

    r71d6bd8 r7030dab  
    33#include "bench.h"
    44
    5 int main(int argc, char* argv[]) {
     5int main( int argc, char * argv[] ) {
     6        BENCH_START()
    67        BENCH(
    7                 for (size_t i = 0; i < n; i++) {
     8                for (size_t i = 0; i < times; i++) {
    89                        uThisTask().yield();
    910                },
    1011                result
    1112        )
     13        printf( "%g\n", result );
     14}
    1215
    13         printf("%g\n", result);
    14 }
     16// Local Variables: //
     17// tab-width: 4 //
     18// End: //
  • benchmark/mutex/JavaThread.java

    r71d6bd8 r7030dab  
    2626        static int x = 2;
    2727
    28         static private final int NoOfTimes = Integer.parseInt("100000000") ;
     28        static private int times = Integer.parseInt("100000000");
    2929
    3030        public synchronized void noop() {
     
    3535                // Inhibit biased locking ...
    3636                x = (j.hashCode() ^ System.identityHashCode(j)) | 1 ;     
    37                 for(int i = 1; i <= NoOfTimes; i += 1) {
     37                for(int i = 1; i <= times; i += 1) {
    3838                        x = nextRandom(x);
    3939                        j.noop();
     
    4444                helper();
    4545                long end = System.nanoTime();
    46                 System.out.println( (end - start) / NoOfTimes );
     46                System.out.println( (end - start) / times );
    4747        }
    4848        public static void main(String[] args) throws InterruptedException {
     49                if ( args.length > 2 ) System.exit( 1 );
     50                if ( args.length == 2 ) { times = Integer.parseInt(args[1]); }
     51
    4952                for (int n = Integer.parseInt("5"); --n >= 0 ; ) {
    5053                        InnerMain();
     
    5558        }
    5659}
     60
     61// Local Variables: //
     62// tab-width: 4 //
     63// End: //
  • benchmark/mutex/cfa1.cfa

    r71d6bd8 r7030dab  
    44#include "bench.h"
    55
    6 monitor M {};
    7 void __attribute__((noinline)) call( M & mutex m ) {}
     6monitor M {} m1;
     7void __attribute__((noinline)) call( M & mutex p1 ) {}
    88
    9 int main(int argc, char* argv[]) {
    10         M m;
     9int main( int argc, char * argv[] ) {
     10        BENCH_START()
    1111        BENCH(
    12                 for ( i; n ) {
    13                         call(m);
     12                for ( times ) {
     13                        call( m1 );
    1414                },
    1515                result
    1616        )
     17        printf( "%g\n", result );
     18}
    1719
    18         printf("%g\n", result);
    19 }
     20// Local Variables: //
     21// tab-width: 4 //
     22// End: //
  • benchmark/mutex/cfa2.cfa

    r71d6bd8 r7030dab  
    44#include "bench.h"
    55
    6 monitor M {};
    7 void __attribute__((noinline)) call( M & mutex m1, M & mutex m2 ) {}
     6monitor M {} m1, m2;
    87
    9 int main(int argc, char* argv[]) {
    10         M m1, m2;
     8void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {}
     9
     10int main( int argc, char * argv[] ) {
     11        BENCH_START()
    1112        BENCH(
    12                 for ( i; n ) {
    13                         call(m1, m2);
     13                for ( times ) {
     14                        call( m1, m2 );
    1415                },
    1516                result
    1617        )
     18        printf( "%g\n", result );
     19}
    1720
    18         printf("%g\n", result);
    19 }
     21// Local Variables: //
     22// tab-width: 4 //
     23// End: //
  • benchmark/mutex/cfa4.cfa

    r71d6bd8 r7030dab  
    55
    66
    7 monitor M {};
    8 void __attribute__((noinline)) call( M & mutex m1, M & mutex m2, M & mutex m3, M & mutex m4 ) {}
     7monitor M {} m1, m2, m3, m4;
     8void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {}
    99
    10 int main(int argc, char* argv[]) {
    11         M m1, m2, m3, m4;
     10int main( int argc, char * argv[] ) {
     11        BENCH_START()
    1212        BENCH(
    13                 for ( i; n ) {
    14                         call(m1, m2, m3, m4);
     13                for ( times ) {
     14                        call( m1, m2, m3, m4 );
    1515                },
    1616                result
    1717        )
     18        printf( "%g\n", result );
     19}
    1820
    19         printf("%g\n", result);
    20 }
     21// Local Variables: //
     22// tab-width: 4 //
     23// End: //
  • benchmark/mutex/pthreads.c

    r71d6bd8 r7030dab  
    77
    88void __attribute__((noinline)) call() {
    9          pthread_mutex_lock  (&mutex);
    10          pthread_mutex_unlock(&mutex);
     9         pthread_mutex_lock( &mutex );
     10         pthread_mutex_unlock( &mutex );
    1111}
    12 
    13 int main(int argc, char* argv[]) {
     12int main( int argc, char * argv[] ) {
     13        BENCH_START()
    1414        BENCH(
    15                 for (size_t i = 0; i < n; i++) {
     15                for ( size_t i = 0; i < times; i++ ) {
    1616                        call();
    1717                },
    1818                result
    1919        )
     20        printf( "%g\n", result );
     21}
    2022
    21         printf("%g\n", result);
    22 }
     23// Local Variables: //
     24// tab-width: 4 //
     25// End: //
  • benchmark/mutex/upp.cc

    r71d6bd8 r7030dab  
    88};
    99
    10 int main(int argc, char* argv[]) {
     10int main( int argc, char * argv[] ) {
     11        BENCH_START()
    1112        MyMonitor m;
    1213        BENCH(
    13                 for (size_t i = 0; i < n; i++) {
     14                for ( size_t i = 0; i < times; i++ ) {
    1415                        m.call();
    1516                },
    1617                result
    1718        )
     19        printf( "%g\n", result );
     20}
    1821
    19         printf("%g\n", result);
    20 }
     22// Local Variables: //
     23// tab-width: 4 //
     24// End: //
  • benchmark/schedext/cfa1.cfa

    r71d6bd8 r7030dab  
    44#include <stdio.h>
    55
    6 #include "bench.h"
     6#include "../bench.h"
    77
    8 int argc;
    9 char** argv;
    10 volatile int go = 0;
     8monitor M {} m1;
    119
    12 monitor M {};
    13 M m1;
    14 
    15 void __attribute__((noinline)) call( M & mutex a1 ) {}
    16 
    17 int  __attribute__((noinline)) wait( M & mutex a1 ) {
    18         go = 1;
    19         BENCH(
    20                 for ( i; n ) {
    21                         waitfor(call, a1);
    22                 },
    23                 result
    24         )
    25 
    26         printf("%g\n", result);
    27         go = 0;
    28         return 0;
     10void __attribute__((noinline)) call( M & mutex p1 ) {}
     11void __attribute__((noinline)) wait( M & mutex p1 ) {
     12        for ( times ) {
     13                waitfor( call : p1 );
     14        }
    2915}
    3016
    3117thread T {};
    32 void ^?{}( T & mutex this ) {}
    3318void main( T & ) {
    34         while(go == 0) { yield(); }
    35         while(go == 1) { call(m1); }
    36 
     19        BENCH(
     20                for ( times ) { call( m1 ); },
     21                result
     22        )
     23        printf( "%g\n", result );
    3724}
    3825
    39 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
     26int main( int argc, char * argv[] ) {
     27        BENCH_START()
    4028        T t;
    41         return wait(m1);
     29        wait( m1 );
    4230}
     31
     32// Local Variables: //
     33// tab-width: 4 //
     34// End: //
  • benchmark/schedext/cfa2.cfa

    r71d6bd8 r7030dab  
    44#include <stdio.h>
    55
    6 #include "bench.h"
     6#include "../bench.h"
    77
    8 int argc;
    9 char** argv;
    10 volatile int go = 0;
     8monitor M {} m1, m2;
    119
    12 monitor M {};
    13 M m1, m2;
    14 
    15 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2 ) {}
    16 
    17 int  __attribute__((noinline)) wait( M & mutex a1, M & mutex a2 ) {
    18         go = 1;
     10void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {}
     11void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) {
     12        for ( times ) {
     13                waitfor( call : p1, p2 );
     14        }
     15}
     16thread T {};
     17void main( T & ) {
    1918        BENCH(
    20                 for ( i; n ) {
    21                         waitfor(call, a1, a2);
     19                for ( times ) {
     20                        call( m1, m2 );
    2221                },
    2322                result
    2423        )
    25 
    26         printf("%g\n", result);
    27         go = 0;
    28         return 0;
     24        printf( "%g\n", result );
    2925}
    3026
    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 
     27int main( int argc, char * argv[] ) {
     28        BENCH_START()
     29        T t;
     30        wait( m1, m2 );
    3731}
    3832
    39 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    40         T t;
    41         return wait(m1, m2);
    42 }
     33// Local Variables: //
     34// tab-width: 4 //
     35// End: //
  • benchmark/schedext/cfa4.cfa

    r71d6bd8 r7030dab  
    44#include <stdio.h>
    55
    6 #include "bench.h"
     6#include "../bench.h"
    77
    8 int argc;
    9 char** argv;
    10 volatile int go = 0;
     8monitor M {} m1, m2, m3, m4;
    119
    12 monitor M {};
    13 M m1, m2, m3, m4;
    14 
    15 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {}
    16 
    17 int  __attribute__((noinline)) wait( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {
    18         go = 1;
     10void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {}
     11void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {
     12        for ( times ) {
     13                waitfor( call : p1, p2, p3, p4 );
     14        }
     15}
     16thread T {};
     17void main( T & ) {
    1918        BENCH(
    20                 for ( i; n ) {
    21                         waitfor(call, a1, a2, a3, a4);
     19                for ( times ) {
     20                        call( m1, m2, m3, m4 );
    2221                },
    2322                result
    2423        )
    25 
    26         printf("%g\n", result);
    27         go = 0;
    28         return 0;
     24        printf( "%g\n", result );
    2925}
    3026
    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 
     27int main( int argc, char * argv[] ) {
     28        BENCH_START()
     29        T t;
     30        wait( m1, m2, m3, m4 );
    3731}
    3832
    39 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    40         T t;
    41         return wait(m1, m2, m3, m4);
    42 }
     33// Local Variables: //
     34// tab-width: 4 //
     35// End: //
  • benchmark/schedext/upp.cc

    r71d6bd8 r7030dab  
    33#include "bench.h"
    44
    5 int argc;
    6 char** argv;
    7 volatile int go = 0;
    8 
    95_Monitor M {
    106public:
    117        void __attribute__((noinline)) call() {}
     8        void __attribute__((noinline)) wait() {
     9                for ( size_t i = 0; i < times; i++ ) {
     10                        _Accept(call);
     11                }
     12        }
     13} m;
    1214
    13         int __attribute__((noinline)) wait() {
    14                 go = 1;
     15_Task T {
     16        void main() {
    1517                BENCH(
    16                         for (size_t i = 0; i < n; i++) {
    17                                 _Accept(call);
     18                        for ( size_t i = 0; i < times; i++ ) {
     19                                m.call();
    1820                        },
    1921                        result
    2022                )
    21 
    22                 printf("%g\n", result);
    23                 go = 0;
    24                 return 0;
     23                printf( "%g\n", result );
    2524        }
    2625};
    2726
    28 M m;
     27int main( int argc, char * argv[] ) {
     28        BENCH_START()
     29        T t;
     30        m.wait();
     31}
    2932
    30 _Task T {
    31         void main() {
    32                 while(go == 0) { yield(); }
    33                 while(go == 1) { m.call(); }
    34 
    35         }
    36 };
    37 
    38 int main(int margc, char* margv[]) {
    39         argc = margc;
    40         argv = margv;
    41         T t;
    42         return m.wait();
    43 }
     33// Local Variables: //
     34// tab-width: 4 //
     35// End: //
  • benchmark/schedint/JavaThread.java

    r71d6bd8 r7030dab  
    4949        static int x = 2;
    5050
    51         static private final int NoOfTimes = Integer.parseInt("1000000") ;
     51        static private int times = Integer.parseInt("1000000");
    5252
    5353        public static void helper( Monitor m ) throws InterruptedException {
    54                 for(int i = 1; i <= NoOfTimes; i += 1) {
     54                for(int i = 1; i <= times; i += 1) {
    5555                        m.wait();               // relase monitor lock
    5656                        m.next = true;
     
    6363                synchronized(m) {
    6464                        s.start();
    65                         while( !Monitor.go ) {
     65                        while( ! Monitor.go ) { // waiter must start first
    6666                                Thread.yield();
    6767                        }
     
    7272                Monitor.go = false;
    7373                s.join();
    74                 System.out.println( (end - start) / NoOfTimes);
     74                System.out.println( (end - start) / times);
    7575        }
    7676        public static void main(String[] args) throws InterruptedException {
     77                if ( args.length > 2 ) System.exit( 1 );
     78                if ( args.length == 2 ) { times = Integer.parseInt(args[1]); }
     79
    7780                for (int n = Integer.parseInt("5"); --n >= 0 ; ) {
    7881                        InnerMain();
     
    8386        }
    8487}
     88
     89// Local Variables: //
     90// tab-width: 4 //
     91// End: //
  • benchmark/schedint/cfa1.cfa

    r71d6bd8 r7030dab  
    44#include <stdio.h>
    55
    6 #include "bench.h"
     6#include "../bench.h"
    77
    8 int argc;
    9 char** argv;
    108volatile int go = 0;
    119
    1210condition c;
    13 monitor M {};
    14 M m1;
     11monitor M {} m1;
    1512
    16 void __attribute__((noinline)) call( M & mutex a1 ) {
    17         signal(c);
     13void __attribute__((noinline)) call( M & mutex p1 ) {
     14        signal( c );
    1815}
    19 
    20 int  __attribute__((noinline)) wait( M & mutex a1 ) {
     16void __attribute__((noinline)) wait( M & mutex p1 ) {
    2117        go = 1;
    22         BENCH(
    23                 for ( i; n ) {
    24                         wait(c);
    25                 },
    26                 result
    27         )
    28 
    29         printf("%g\n", result);
    30         go = 0;
    31         return 0;
     18        for ( times ) {
     19                wait( c );
     20        }
    3221}
    3322
    3423thread T {};
    35 void ^?{}( T & mutex ) {}
    3624void main( T & ) {
    37         while(go == 0) { yield(); }
    38         while(go == 1) { call(m1); }
    39 
     25        while ( go == 0 ) { yield(); } // waiter must start first
     26        BENCH(
     27                for ( times ) { call( m1 ); },
     28                result
     29        )
     30        printf( "%g\n", result );
    4031}
    4132
    42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
     33int main( int argc, char * argv[] ) {
     34        BENCH_START()
    4335        T t;
    44         return wait(m1);
     36        wait( m1 );
    4537}
     38
     39// Local Variables: //
     40// tab-width: 4 //
     41// End: //
  • benchmark/schedint/cfa2.cfa

    r71d6bd8 r7030dab  
    44#include <stdio.h>
    55
    6 #include "bench.h"
     6#include "../bench.h"
    77
    8 int argc;
    9 char** argv;
    108volatile int go = 0;
    119
    1210condition c;
    13 monitor M {};
    14 M m1, m2;
     11monitor M {} m1, m2;
    1512
    16 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2 ) {
    17         signal(c);
     13void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {
     14        signal( c );
    1815}
    19 
    20 int  __attribute__((noinline)) wait( M & mutex a1, M & mutex a2 ) {
     16void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) {
    2117        go = 1;
    22         BENCH(
    23                 for ( i; n ) {
    24                         wait(c);
    25                 },
    26                 result
    27         )
    28 
    29         printf("%g\n", result);
    30         go = 0;
    31         return 0;
     18        for ( times ) {
     19                wait( c );
     20        }
    3221}
    3322
    3423thread T {};
    35 void ^?{}( T & mutex this ) {}
    3624void main( T & ) {
    37         while(go == 0) { yield(); }
    38         while(go == 1) { call(m1, m2); }
    39 
     25        while ( go == 0 ) { yield(); } // waiter must start first
     26        BENCH(
     27                for ( times ) { call( m1, m2 ); },
     28                result
     29        )
     30        printf( "%g\n", result );
    4031}
    4132
    42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
     33int main( int argc, char * argv[] ) {
     34        BENCH_START()
    4335        T t;
    44         return wait(m1, m2);
     36        wait( m1, m2 );
    4537}
     38
     39// Local Variables: //
     40// tab-width: 4 //
     41// End: //
  • benchmark/schedint/cfa4.cfa

    r71d6bd8 r7030dab  
    44#include <stdio.h>
    55
    6 #include "bench.h"
     6#include "../bench.h"
    77
    8 int argc;
    9 char** argv;
    108volatile int go = 0;
    119
    1210condition c;
    13 monitor M {};
    14 M m1, m2, m3, m4;
     11monitor M {} m1, m2, m3, m4;
    1512
    16 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {
    17         signal(c);
     13void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {
     14        signal( c );
    1815}
    19 
    20 int  __attribute__((noinline)) wait( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {
     16void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {
    2117        go = 1;
    22         BENCH(
    23                 for ( i; n ) {
    24                         wait(c);
    25                 },
    26                 result
    27         )
    28 
    29         printf("%g\n", result);
    30         go = 0;
    31         return 0;
     18        for ( times ) {
     19                wait( c );
     20        }
    3221}
    3322
    3423thread T {};
    35 void ^?{}( T & mutex this ) {}
    3624void main( T & ) {
    37         while(go == 0) { yield(); }
    38         while(go == 1) { call(m1, m2, m3, m4); }
    39 
     25        while ( go == 0 ) { yield(); } // waiter must start first
     26        BENCH(
     27                for ( times ) { call( m1, m2, m3, m4 ); },
     28                result
     29        )
     30        printf( "%g\n", result );
    4031}
    4132
    42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
     33int main( int argc, char * argv[] ) {
     34        BENCH_START()
    4335        T t;
    44         return wait(m1, m2, m3, m4);
     36        wait( m1, m2, m3, m4 );
    4537}
     38
     39// Local Variables: //
     40// tab-width: 4 //
     41// End: //
  • benchmark/schedint/pthreads.c

    r71d6bd8 r7030dab  
    44#include "bench.h"
    55
    6 int argc;
    7 char** argv;
    86volatile int go = 0;
    97
     8pthread_mutex_t m;
    109pthread_cond_t c;
    11 pthread_mutex_t m;
    1210
    1311void __attribute__((noinline)) call() {
    14         pthread_mutex_lock(&m);
    15         pthread_cond_signal(&c);
    16         pthread_mutex_unlock(&m);
     12        pthread_mutex_lock( &m );
     13        pthread_cond_signal( &c );
     14        pthread_mutex_unlock( &m );
    1715}
    1816
    19 int __attribute__((noinline)) wait() {
     17void __attribute__((noinline)) wait() {
    2018        pthread_mutex_lock(&m);
    2119        go = 1;
     20        for ( size_t i = 0; i < times; i++ ) {
     21                pthread_cond_wait( &c, &m );
     22        }
     23        go = 0;
     24        pthread_mutex_unlock( &m );
     25}
     26
     27void * thread_main( __attribute__((unused)) void * arg ) {
     28        while ( go == 0 ) { sched_yield(); } // waiter must start first
     29        // barging for lock acquire => may not execute N times
    2230        BENCH(
    23                 for (size_t i = 0; i < n; i++) {
    24                         pthread_cond_wait(&c, &m);
    25                 },
     31                while ( go == 1 ) { call(); },
    2632                result
    2733        )
    28 
    29         printf("%g\n", result);
    30         go = 0;
    31         pthread_mutex_unlock(&m);
    32         return 0;
    33 }
    34 
    35 void* thread_main(__attribute__((unused)) void * arg ) {
    36         while(go == 0) { sched_yield(); }
    37         while(go == 1) { call(); }
     34        printf( "%g\n", result );
    3835        return NULL;
    3936}
    4037
    41 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
     38int main( int argc, char * argv[] ) {
     39        BENCH_START()
    4240        pthread_t thread;
    43         if (pthread_create(&thread, NULL, thread_main, NULL) < 0) {
     41        if ( pthread_create( &thread, NULL, thread_main, NULL ) < 0 ) {
    4442                perror( "failure" );
    4543                return 1;
    4644        }
    4745        wait();
    48         if (pthread_join( thread, NULL) < 0) {
     46        if ( pthread_join( thread, NULL ) < 0 ) {
    4947                perror( "failure" );
    5048                return 1;
    5149        }
    52         return 0;
    5350}
     51
     52// Local Variables: //
     53// tab-width: 4 //
     54// End: //
  • benchmark/schedint/upp.cc

    r71d6bd8 r7030dab  
    33#include "bench.h"
    44
    5 int argc;
    6 char** argv;
    75volatile int go = 0;
    86
     
    1311                cond.signal();
    1412        }
     13        void __attribute__((noinline)) wait() {
     14                go = 1;
     15                for ( size_t i = 0; i < times; i++ ) {
     16                        cond.wait();
     17                }
     18        }
     19} m;
    1520
    16         int __attribute__((noinline)) wait() {
    17                 go = 1;
     21_Task T {
     22        void main() {
     23                while ( go == 0 ) { yield(); } // waiter must start first
    1824                BENCH(
    19                         for (size_t i = 0; i < n; i++) {
    20                                 cond.wait();
     25                        for ( size_t i = 0; i < times; i++ ) {
     26                                m.call();
    2127                        },
    2228                        result
    2329                )
    24 
    25                 printf("%g\n", result);
    26                 go = 0;
    27                 return 0;
     30                printf( "%g\n", result );
    2831        }
    2932};
    3033
    31 M m;
     34int main( int argc, char * argv[] ) {
     35        BENCH_START()
     36        T t;
     37        m.wait();
     38}
    3239
    33 _Task T {
    34         void main() {
    35                 while(go == 0) { yield(); }
    36                 while(go == 1) { m.call(); }
    37 
    38         }
    39 };
    40 
    41 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    42         T t;
    43         return m.wait();
    44 }
     40// Local Variables: //
     41// tab-width: 4 //
     42// End: //
Note: See TracChangeset for help on using the changeset viewer.