- Timestamp:
- Feb 20, 2020, 4:15:51 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6a490b2
- Parents:
- dca5802 (diff), 2cbfe92 (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. - Location:
- benchmark
- Files:
-
- 23 added
- 3 deleted
- 38 edited
- 4 moved
-
Makefile.am (modified) (11 diffs)
-
Makefile.in (modified) (10 diffs)
-
baselines/x64/schedint.csv (moved) (moved from benchmark/baselines/x64/signal.csv ) (1 diff)
-
baselines/x86/schedint.csv (moved) (moved from benchmark/baselines/x86/signal.csv ) (1 diff)
-
basic/fetch_add.c (added)
-
basic/function.c (added)
-
basic/loop.c (added)
-
basic/tls_fetch_add.c (moved) (moved from benchmark/tls-fetch_add.c ) (2 diffs)
-
basic/ttst_lock.c (moved) (moved from benchmark/ttst_lock.c ) (2 diffs)
-
bench.h (modified) (3 diffs)
-
creation/JavaThread.java (modified) (4 diffs)
-
creation/cfa_cor.cfa (modified) (1 diff)
-
creation/cfa_gen.cfa (added)
-
creation/cfa_thrd.cfa (modified) (1 diff)
-
creation/goroutine.go (modified) (2 diffs)
-
creation/node_cor.js (added)
-
creation/pthreads.c (modified) (3 diffs)
-
creation/python_cor.py (added)
-
creation/rust_thrd.rs (added)
-
creation/upp_cor.cc (modified) (1 diff)
-
creation/upp_thrd.cc (modified) (1 diff)
-
ctxswitch/JavaThread.java (modified) (3 diffs)
-
ctxswitch/cfa_cor.cfa (modified) (1 diff)
-
ctxswitch/cfa_cor_then.cfa (modified) (1 diff)
-
ctxswitch/cfa_gen.cfa (modified) (1 diff)
-
ctxswitch/cfa_thrd.cfa (modified) (1 diff)
-
ctxswitch/cfa_thrd2.cfa (modified) (1 diff)
-
ctxswitch/goroutine.go (modified) (2 diffs)
-
ctxswitch/kos_fibre.cpp (modified) (1 diff)
-
ctxswitch/kos_fibre2.cpp (modified) (1 diff)
-
ctxswitch/node_await.js (added)
-
ctxswitch/node_cor.js (added)
-
ctxswitch/pthreads.c (modified) (1 diff)
-
ctxswitch/python_cor.py (added)
-
ctxswitch/rust_thrd.rs (added)
-
ctxswitch/upp_cor.cc (modified) (2 diffs)
-
ctxswitch/upp_thrd.cc (modified) (1 diff)
-
exclude (added)
-
fetch_add.c (deleted)
-
function.c (deleted)
-
loop.c (deleted)
-
mutex/JavaThread.java (modified) (4 diffs)
-
mutex/cfa1.cfa (modified) (1 diff)
-
mutex/cfa2.cfa (modified) (1 diff)
-
mutex/cfa4.cfa (modified) (1 diff)
-
mutex/goroutine.go (added)
-
mutex/pthreads.c (modified) (1 diff)
-
mutex/rust.rs (added)
-
mutex/upp.cc (modified) (1 diff)
-
mutexC/JavaThread.java (added)
-
mutexC/cfa1.cfa (added)
-
mutexC/cfa2.cfa (added)
-
mutexC/cfa4.cfa (added)
-
mutexC/pthreads.c (added)
-
mutexC/rust.rs (added)
-
mutexC/upp.cc (added)
-
schedext/cfa1.cfa (modified) (1 diff)
-
schedext/cfa2.cfa (modified) (1 diff)
-
schedext/cfa4.cfa (modified) (1 diff)
-
schedext/goroutine.go (added)
-
schedext/upp.cc (modified) (1 diff)
-
schedint/JavaThread.java (modified) (4 diffs)
-
schedint/cfa1.cfa (modified) (1 diff)
-
schedint/cfa2.cfa (modified) (1 diff)
-
schedint/cfa4.cfa (modified) (1 diff)
-
schedint/pthreads.c (modified) (1 diff)
-
schedint/rust.rs (added)
-
schedint/upp.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/Makefile.am
rdca5802 rb7d6a36 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Mon Jul 29 18:02:19 201914 ## Update Count : 5413 ## Last Modified On : Sat Jan 25 09:20:44 2020 14 ## Update Count : 255 15 15 ############################################################################### 16 16 … … 28 28 BENCH_V_CFA = $(__bench_v_CFA_$(__quiet)) 29 29 BENCH_V_CXX = $(__bench_v_CXX_$(__quiet)) 30 BENCH_V_UPP = $(__bench_v_UPP_$(__quiet)) 30 31 BENCH_V_GOC = $(__bench_v_GOC_$(__quiet)) 32 BENCH_V_PY = $(__bench_v_PY_$(__quiet)) 33 BENCH_V_RUSTC = $(__bench_v_RUSTC_$(__quiet)) 34 BENCH_V_NODEJS = $(__bench_v_NODEJS_$(__quiet)) 31 35 BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet)) 32 BENCH_V_UPP = $(__bench_v_UPP_$(__quiet))33 36 34 37 __quiet = verbose … … 36 39 __bench_v_CFA_quiet = @ 37 40 __bench_v_CXX_quiet = @ 41 __bench_v_UPP_quiet = @ 38 42 __bench_v_GOC_quiet = @ 43 __bench_v_RUSTC_quiet = @ 39 44 __bench_v_JAVAC_quiet = @ 40 __bench_v_UPP_quiet = @41 45 __bench_v_CC_verbose = $(AM_V_CC) 42 46 __bench_v_CFA_verbose = $(AM_V_CFA) 43 47 __bench_v_CXX_verbose = $(AM_V_CXX) 48 __bench_v_UPP_verbose = $(AM_V_UPP) 44 49 __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) 45 53 __bench_v_JAVAC_verbose = $(AM_V_JAVAC) 46 __bench_v_UPP_verbose = $(AM_V_UPP)47 54 48 55 … … 51 58 STATS = ${abs_top_srcdir}/tools/stat.py 52 59 # NEED AT LEAST 4 DATA VALUES FOR BENCHMARKS BECAUSE THE MAX AND MIN VALUES ARE REMOVED 53 repeats = 5# 31 for benchmarks60 repeats = 13 # 31 for benchmarks 54 61 arch = x64 55 62 skipcompile = no … … 62 69 63 70 dummyC.c: 64 @echo "int main() { return 0; }" > ${@}71 echo "int main() { return 0; }" > ${@} 65 72 66 73 dummyCXX.cpp: 67 @echo "int main() { return 0; }" > ${@} 68 74 echo "int main() { return 0; }" > ${@} 75 76 .SILENT: # do not print recipe 69 77 .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 82 all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) schedint$(EXEEXT) schedext$(EXEEXT) creation$(EXEEXT) 83 84 basic_loop_DURATION = 15000000000 85 basic_function_DURATION = 10000000000 86 basic_tls_fetch_add_DURATION = 10000000000 87 basic_DURATION = 250000000 88 89 ctxswitch_pthread_DURATION = 25000000 90 ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION) 91 ctxswitch_cfa_generator_DURATION = 5000000000 92 ctxswitch_nodejs_await_DURATION = 5000000 93 ctxswitch_DURATION = 100000000 94 95 #mutex_java_DURATION = 10000000 96 mutex_DURATION = 50000000 97 98 schedint_pthread_DURATION = 1000000 99 schedint_java_DURATION = $(schedint_pthread_DURATION) 100 schedint_rust_DURATION = $(schedint_pthread_DURATION) 101 schedint_DURATION = 10000000 102 103 schedext_DURATION = 10000000 104 105 creation_pthread_DURATION = 250000 106 creation_rust_thread_DURATION = ${creation_pthread_DURATION} 107 creation_java_thread_DURATION = ${creation_pthread_DURATION} 108 creation_cfa_coroutine_DURATION = 100000000 109 creation_cfa_coroutine_eager_DURATION = 10000000 110 creation_upp_coroutine_DURATION = ${creation_cfa_coroutine_eager_DURATION} 111 creation_cfa_thread_DURATION = 10000000 112 creation_upp_thread_DURATION = ${creation_cfa_thread_DURATION} 113 creation_DURATION = 10000000 74 114 75 115 %.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 116 rm -f .result.log 117 echo "------------------------------------------------------" 118 echo $< 119 ${REPEAT} ${repeats} -- ./a.out\ 120 $(if ${$(subst -,_,$(basename $@))_DURATION},\ 121 ${$(subst -,_,$(basename $@))_DURATION},\ 122 ${$(firstword $(subst -, ,$(basename $@)))_DURATION}) | tee -a .result.log 123 ${STATS} .result.log 124 echo "------------------------------------------------------" 125 rm -f a.out .result.log *.class 126 127 # ${REPEAT} ${repeats} -- /usr/bin/time -f "%Uu %Ss %Er %Mkb" ./a.out 83 128 84 129 %.runquiet : 85 @+make $(basename $@) CFLAGS="-w" __quiet=quiet86 @taskset -c 1 ./a.out87 @rm -f a.out130 +make $(basename $@) CFLAGS="-w" __quiet=quiet 131 taskset -c 1 ./a.out 132 rm -f a.out 88 133 89 134 %.make : 90 @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@))91 @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1135 printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@)) 136 +/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1 92 137 93 138 ${REPEAT} : 94 @+make -C ${abs_top_builddir}/tools repeat139 +make -C ${abs_top_builddir}/tools repeat 95 140 96 141 ## ========================================================================================================= … … 98 143 FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@ 99 144 100 jenkins$(EXEEXT): 145 cleancsv: 146 rm -f compile.csv basic.csv ctxswitch.csv mutex.csv scheduling.csv 147 148 jenkins$(EXEEXT): cleancsv 101 149 @DOifskipcompile@ 102 @+make compile.csv103 @-+make compile.diff.csv150 +make compile.csv 151 -+make compile.diff.csv 104 152 @DOendif@ 105 @+make ctxswitch.csv106 @-+make ctxswitch.diff.csv107 @+make mutex.csv108 @-+make mutex.diff.csv109 @+make signal.csv110 @-+make signal.diff.csv153 +make ctxswitch.csv 154 -+make ctxswitch.diff.csv 155 +make mutex.csv 156 -+make mutex.diff.csv 157 +make scheduling.csv 158 -+make scheduling.diff.csv 111 159 @DOifskipcompile@ 112 160 cat compile.csv … … 117 165 cat mutex.csv 118 166 -cat mutex.diff.csv 119 cat s ignal.csv120 -cat s ignal.diff.csv167 cat scheduling.csv 168 -cat scheduling.diff.csv 121 169 122 170 compile.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 $@ 171 echo "building $@" 172 echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@ 173 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@ 174 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@ 175 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@ 176 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@ 177 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@ 178 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@ 179 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@ 180 +make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@ 181 $(srcdir)/fixcsv.sh $@ 133 182 134 183 ctxswitch.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 $@ 184 echo "building $@" 185 echo "generator,coroutine,thread" > $@ 186 +make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@ 187 +make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@ 188 +make ctxswitch-cfa_thread.runquiet >> $@ 189 $(srcdir)/fixcsv.sh $@ 140 190 141 191 mutex.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 $@ 192 echo "building $@" 193 echo "1-monitor,2-monitor" > $@ 194 +make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@ 195 +make mutex-cfa2.runquiet >> $@ 196 $(srcdir)/fixcsv.sh $@ 197 198 scheduling.csv: 199 echo "building $@" 200 echo "schedint-1,schedint-2,schedext-1,schedext-2" > $@ 201 +make schedint-cfa1.runquiet >> $@ && echo -n ',' >> $@ 202 +make schedint-cfa2.runquiet >> $@ && echo -n ',' >> $@ 203 +make schedext-cfa1.runquiet >> $@ && echo -n ',' >> $@ 204 +make schedext-cfa2.runquiet >> $@ 205 $(srcdir)/fixcsv.sh $@ 154 206 155 207 %.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 \ 208 test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false) 209 $(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@ 210 211 ## ========================================================================================================= 212 213 BASIC_DEPEND = \ 214 basic-loop.run \ 215 basic-function.run \ 216 basic-fetch_add.run \ 217 basic-ttst_lock.run \ 218 basic-tls-fetch_add.run 219 220 basic-loop$(EXEEXT): 221 $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/loop.c 222 223 basic-function$(EXEEXT): 224 $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/function.c 225 226 basic-fetch_add$(EXEEXT): 227 $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/fetch_add.c 228 229 basic-ttst_lock$(EXEEXT): 230 $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/ttst_lock.c 231 232 basic-tls-fetch_add$(EXEEXT): 233 $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/tls_fetch_add.c 234 235 basic$(EXEEXT): $(BASIC_DEPEND) 236 237 ## ========================================================================================================= 238 239 CTXSWITCH_DEPEND = \ 184 240 ctxswitch-cfa_generator.run \ 185 241 ctxswitch-cfa_coroutine.run \ … … 188 244 ctxswitch-upp_coroutine.run \ 189 245 ctxswitch-upp_thread.run \ 190 ctxswitch-goroutine.run \ 191 ctxswitch-java_thread.run 192 246 ctxswitch-python_coroutine.run \ 247 ctxswitch-nodejs_coroutine.run \ 248 ctxswitch-nodejs_await.run \ 249 ctxswitch-goroutine_thread.run \ 250 ctxswitch-rust_thread.run \ 251 ctxswitch-nodejs_coroutine.run \ 252 ctxswitch-java_thread.run \ 253 ctxswitch-pthread.run 193 254 194 255 if WITH_LIBFIBRE 195 CTXSWITCH_DEPEND += \196 ctxswitch-kos_fibre.run \256 CTXSWITCH_DEPEND += \ 257 ctxswitch-kos_fibre.run \ 197 258 ctxswitch-kos_fibre2.run 198 199 259 200 260 ctxswitch-kos_fibre$(EXEEXT): … … 207 267 ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) 208 268 209 ctxswitch-pthread$(EXEEXT):210 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c211 212 269 ctxswitch-cfa_generator$(EXEEXT): 213 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000$(srcdir)/ctxswitch/cfa_gen.cfa270 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_gen.cfa 214 271 215 272 ctxswitch-cfa_coroutine$(EXEEXT): 216 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000$(srcdir)/ctxswitch/cfa_cor.cfa273 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_cor.cfa 217 274 218 275 ctxswitch-cfa_thread$(EXEEXT): 219 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000$(srcdir)/ctxswitch/cfa_thrd.cfa276 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd.cfa 220 277 221 278 ctxswitch-cfa_thread2$(EXEEXT): 222 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000$(srcdir)/ctxswitch/cfa_thrd2.cfa279 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd2.cfa 223 280 224 281 ctxswitch-upp_coroutine$(EXEEXT): 225 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000$(srcdir)/ctxswitch/upp_cor.cc282 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_cor.cc 226 283 227 284 ctxswitch-upp_thread$(EXEEXT): 228 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc 229 230 ctxswitch-goroutine$(EXEEXT): 285 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_thrd.cc 286 287 ctxswitch-python_coroutine$(EXEEXT): 288 $(BENCH_V_PY)echo "#!/bin/sh" > a.out 289 echo "python3.7 $(srcdir)/ctxswitch/python_cor.py" >> a.out 290 chmod a+x a.out 291 292 ctxswitch-nodejs_coroutine$(EXEEXT): 293 $(BENCH_V_NODEJS)echo "#!/bin/sh" > a.out 294 echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out 295 chmod a+x a.out 296 297 ctxswitch-nodejs_await$(EXEEXT): 298 $(BENCH_V_NODEJS)echo "#!/bin/sh" > a.out 299 echo "nodejs $(srcdir)/ctxswitch/node_await.js" >> a.out 300 chmod a+x a.out 301 302 ctxswitch-goroutine_thread$(EXEEXT): 231 303 $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go 304 305 ctxswitch-rust_thread$(EXEEXT): 306 $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/ctxswitch/rust_thrd.rs 232 307 233 308 ctxswitch-java_thread$(EXEEXT): 234 309 $(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 \ 310 echo "#!/bin/sh" > a.out 311 echo "java JavaThread" >> a.out 312 chmod a+x a.out 313 314 ctxswitch-pthread$(EXEEXT): 315 $(BENCH_V_CC)$(COMPILE) $(srcdir)/ctxswitch/pthreads.c 316 317 ## ========================================================================================================= 318 319 mutex$(EXEEXT) : \ 246 320 mutex-cfa1.run \ 247 321 mutex-cfa2.run \ 248 322 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 323 mutex-upp.run \ 324 mutex-go.run \ 325 mutex-rust.run \ 326 mutex-java.run \ 327 mutex-pthread.run 328 329 mutex-pthread$(EXEEXT): 330 $(BENCH_V_CC)$(COMPILE) $(srcdir)/mutex/pthreads.c 331 332 mutex-cfa1$(EXEEXT): 333 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa1.cfa 334 335 mutex-cfa2$(EXEEXT): 336 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa2.cfa 337 338 mutex-cfa4$(EXEEXT): 339 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa4.cfa 253 340 254 341 mutex-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): 342 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/mutex/upp.cc 343 344 mutex-go$(EXEEXT): 345 $(BENCH_V_GOC)go build -o a.out $(srcdir)/mutex/goroutine.go 346 347 mutex-rust$(EXEEXT): 348 $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/mutex/rust.rs 349 350 mutex-java$(EXEEXT): 267 351 $(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): 352 echo "#!/bin/sh" > a.out 353 echo "java JavaThread" >> a.out 354 chmod a+x a.out 355 356 ## ========================================================================================================= 357 358 schedint$(EXEEXT) : \ 359 schedint-cfa1.run \ 360 schedint-cfa2.run \ 361 schedint-cfa4.run \ 362 schedint-upp.run \ 363 schedint-rust.run \ 364 schedint-java.run \ 365 schedint-pthread.run 366 367 schedint-cfa1$(EXEEXT): 368 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa 369 370 schedint-cfa2$(EXEEXT): 371 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa 372 373 schedint-cfa4$(EXEEXT): 374 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa 375 376 schedint-upp$(EXEEXT): 377 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc 378 379 schedint-rust$(EXEEXT): 380 $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs 381 382 schedint-java$(EXEEXT): 297 383 $(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 \ 384 echo "#!/bin/sh" > a.out 385 echo "java JavaThread" >> a.out 386 chmod a+x a.out 387 388 schedint-pthread$(EXEEXT): 389 $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c 390 391 ## ========================================================================================================= 392 393 schedext$(EXEEXT) : \ 394 schedext-cfa1.run \ 395 schedext-cfa2.run \ 396 schedext-cfa4.run \ 397 schedext-upp.run \ 398 schedext-goroutine.run 399 400 schedext-cfa1$(EXEEXT): 401 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa 402 403 schedext-cfa2$(EXEEXT): 404 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa 405 406 schedext-cfa4$(EXEEXT): 407 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa 408 409 schedext-upp$(EXEEXT): 410 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc 411 412 schedext-goroutine$(EXEEXT): 413 $(BENCH_V_GOC)go build -o a.out $(srcdir)/schedext/goroutine.go 414 415 416 ## ========================================================================================================= 417 418 creation$(EXEEXT) : \ 419 creation-cfa_generator.run \ 325 420 creation-cfa_coroutine.run \ 326 421 creation-cfa_coroutine_eager.run \ … … 328 423 creation-upp_coroutine.run \ 329 424 creation-upp_thread.run \ 330 creation-goroutine.run \ 331 creation-java_thread.run 425 creation-python_coroutine.run \ 426 creation-nodejs_coroutine.run \ 427 creation-goroutine_thread.run \ 428 creation-rust_thread.run \ 429 creation-java_thread.run \ 430 creation-pthread.run 431 432 creation-cfa_generator$(EXEEXT): 433 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_gen.cfa 332 434 333 435 creation-cfa_coroutine$(EXEEXT): 334 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000$(srcdir)/creation/cfa_cor.cfa436 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa 335 437 336 438 creation-cfa_coroutine_eager$(EXEEXT): 337 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000$(srcdir)/creation/cfa_cor.cfa -DEAGER439 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa -DEAGER 338 440 339 441 creation-cfa_thread$(EXEEXT): 340 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000$(srcdir)/creation/cfa_thrd.cfa442 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_thrd.cfa 341 443 342 444 creation-upp_coroutine$(EXEEXT): 343 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000$(srcdir)/creation/upp_cor.cc445 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_cor.cc 344 446 345 447 creation-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): 448 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_thrd.cc 449 450 creation-python_coroutine$(EXEEXT): 451 $(BENCH_V_PY)echo "#!/bin/sh" > a.out 452 echo "python3.7 $(srcdir)/creation/python_cor.py" >> a.out 453 chmod a+x a.out 454 455 creation-nodejs_coroutine$(EXEEXT): 456 $(BENCH_V_NODEJS)echo "#!/bin/sh" > a.out 457 echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out 458 chmod a+x a.out 459 460 creation-goroutine_thread$(EXEEXT): 352 461 $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go 462 463 creation-rust_thread$(EXEEXT): 464 $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs 353 465 354 466 creation-java_thread$(EXEEXT): 355 467 $(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) :\ 468 echo "#!/bin/sh" > a.out 469 echo "java JavaThread" >> a.out 470 chmod a+x a.out 471 472 creation-pthread$(EXEEXT): 473 $(BENCH_V_CC)$(COMPILE) $(srcdir)/creation/pthreads.c 474 475 ## ========================================================================================================= 476 477 compile$(EXEEXT) : \ 363 478 compile-array.make \ 364 479 compile-attributes.make \ … … 370 485 compile-typeof.make 371 486 372 373 487 testdir = $(top_srcdir)/tests 374 488 375 489 compile-array$(EXEEXT): 376 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa490 $(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa 377 491 378 492 compile-attributes$(EXEEXT): 379 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa493 $(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa 380 494 381 495 compile-empty$(EXEEXT): 382 @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa496 $(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa 383 497 384 498 compile-expression$(EXEEXT): 385 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa499 $(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa 386 500 387 501 compile-io$(EXEEXT): 388 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa502 $(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa 389 503 390 504 compile-monitor$(EXEEXT): 391 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa505 $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa 392 506 393 507 compile-operators$(EXEEXT): 394 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa508 $(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa 395 509 396 510 compile-thread$(EXEEXT): 397 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa511 $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa 398 512 399 513 compile-typeof$(EXEEXT): 400 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa514 $(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa -
benchmark/Makefile.in
rdca5802 rb7d6a36 93 93 EXTRA_PROGRAMS = dummy$(EXEEXT) 94 94 @WITH_LIBFIBRE_TRUE@am__append_1 = \ 95 @WITH_LIBFIBRE_TRUE@ ctxswitch-kos_fibre.run \95 @WITH_LIBFIBRE_TRUE@ ctxswitch-kos_fibre.run \ 96 96 @WITH_LIBFIBRE_TRUE@ ctxswitch-kos_fibre2.run 97 97 … … 358 358 am__v_CFA_0 = @echo " CFA " $@; 359 359 am__v_CFA_1 = 360 AM_V_JAVAC = $(am__v_JAVAC_@AM_V@)361 am__v_JAVAC_ = $(am__v_JAVAC_@AM_DEFAULT_V@)362 am__v_JAVAC_0 = @echo " JAVAC " $@;363 am__v_JAVAC_1 =364 AM_V_GOC = $(am__v_GOC_@AM_V@)365 am__v_GOC_ = $(am__v_GOC_@AM_DEFAULT_V@)366 am__v_GOC_0 = @echo " GOC " $@;367 am__v_GOC_1 =368 360 UPPCC = u++ 369 361 UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS) … … 372 364 am__v_UPP_0 = @echo " UPP " $@; 373 365 am__v_UPP_1 = 366 AM_V_GOC = $(am__v_GOC_@AM_V@) 367 am__v_GOC_ = $(am__v_GOC_@AM_DEFAULT_V@) 368 am__v_GOC_0 = @echo " GOC " $@; 369 am__v_GOC_1 = 370 AM_V_PY = $(am__v_PY_@AM_V@) 371 am__v_PY_ = $(am__v_PY_@AM_DEFAULT_V@) 372 am__v_PY_0 = @echo " PYTHON " $@; 373 am__v_PY_1 = 374 AM_V_RUST = $(am__v_RUST_@AM_V@) 375 am__v_RUST_ = $(am__v_RUST_@AM_DEFAULT_V@) 376 am__v_RUST_0 = @echo " RUST " $@; 377 am__v_RUST_1 = 378 AM_V_NODEJS = $(am__v_NODEJS_@AM_V@) 379 am__v_NODEJS_ = $(am__v_NODEJS_@AM_DEFAULT_V@) 380 am__v_NODEJS_0 = @echo " NODEJS " $@; 381 am__v_NODEJS_1 = 382 AM_V_JAVAC = $(am__v_JAVAC_@AM_V@) 383 am__v_JAVAC_ = $(am__v_JAVAC_@AM_DEFAULT_V@) 384 am__v_JAVAC_0 = @echo " JAVAC " $@; 385 am__v_JAVAC_1 = 374 386 375 387 # applies to both programs … … 380 392 BENCH_V_CFA = $(__bench_v_CFA_$(__quiet)) 381 393 BENCH_V_CXX = $(__bench_v_CXX_$(__quiet)) 394 BENCH_V_UPP = $(__bench_v_UPP_$(__quiet)) 382 395 BENCH_V_GOC = $(__bench_v_GOC_$(__quiet)) 396 BENCH_V_PY = $(__bench_v_PY_$(__quiet)) 397 BENCH_V_RUSTC = $(__bench_v_RUSTC_$(__quiet)) 398 BENCH_V_NODEJS = $(__bench_v_NODEJS_$(__quiet)) 383 399 BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet)) 384 BENCH_V_UPP = $(__bench_v_UPP_$(__quiet))385 400 __quiet = verbose 386 401 __bench_v_CC_quiet = @ 387 402 __bench_v_CFA_quiet = @ 388 403 __bench_v_CXX_quiet = @ 404 __bench_v_UPP_quiet = @ 389 405 __bench_v_GOC_quiet = @ 406 __bench_v_RUSTC_quiet = @ 390 407 __bench_v_JAVAC_quiet = @ 391 __bench_v_UPP_quiet = @392 408 __bench_v_CC_verbose = $(AM_V_CC) 393 409 __bench_v_CFA_verbose = $(AM_V_CFA) 394 410 __bench_v_CXX_verbose = $(AM_V_CXX) 411 __bench_v_UPP_verbose = $(AM_V_UPP) 395 412 __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) 396 416 __bench_v_JAVAC_verbose = $(AM_V_JAVAC) 397 __bench_v_UPP_verbose = $(AM_V_UPP)398 417 TOOLSDIR = ${abs_top_builddir}/tools/ 399 418 REPEAT = ${abs_top_builddir}/tools/repeat 400 419 STATS = ${abs_top_srcdir}/tools/stat.py 401 420 # NEED AT LEAST 4 DATA VALUES FOR BENCHMARKS BECAUSE THE MAX AND MIN VALUES ARE REMOVED 402 repeats = 5# 31 for benchmarks421 repeats = 13 # 31 for benchmarks 403 422 arch = x64 404 423 skipcompile = no … … 406 425 PRINT_FORMAT = %20s: #Comments needed for spacing 407 426 dummy_SOURCES = dummyC.c dummyCXX.cpp 427 basic_loop_DURATION = 15000000000 428 basic_function_DURATION = 10000000000 429 basic_tls_fetch_add_DURATION = 10000000000 430 basic_DURATION = 250000000 431 ctxswitch_pthread_DURATION = 25000000 432 ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION) 433 ctxswitch_cfa_generator_DURATION = 5000000000 434 ctxswitch_nodejs_await_DURATION = 5000000 435 ctxswitch_DURATION = 100000000 436 437 #mutex_java_DURATION = 10000000 438 mutex_DURATION = 50000000 439 schedint_pthread_DURATION = 1000000 440 schedint_java_DURATION = $(schedint_pthread_DURATION) 441 schedint_rust_DURATION = $(schedint_pthread_DURATION) 442 schedint_DURATION = 10000000 443 schedext_DURATION = 10000000 444 creation_pthread_DURATION = 250000 445 creation_rust_thread_DURATION = ${creation_pthread_DURATION} 446 creation_java_thread_DURATION = ${creation_pthread_DURATION} 447 creation_cfa_coroutine_DURATION = 100000000 448 creation_cfa_coroutine_eager_DURATION = 10000000 449 creation_upp_coroutine_DURATION = ${creation_cfa_coroutine_eager_DURATION} 450 creation_cfa_thread_DURATION = 10000000 451 creation_upp_thread_DURATION = ${creation_cfa_thread_DURATION} 452 creation_DURATION = 10000000 408 453 FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@ 409 CTXSWITCH_DEPEND = loop.run function.run fetch_add.run ttst_lock.run \ 410 tls-fetch_add.run ctxswitch-pthread.run \ 411 ctxswitch-cfa_generator.run ctxswitch-cfa_coroutine.run \ 412 ctxswitch-cfa_thread.run ctxswitch-cfa_thread2.run \ 413 ctxswitch-upp_coroutine.run ctxswitch-upp_thread.run \ 414 ctxswitch-goroutine.run ctxswitch-java_thread.run \ 415 $(am__append_1) 454 BASIC_DEPEND = \ 455 basic-loop.run \ 456 basic-function.run \ 457 basic-fetch_add.run \ 458 basic-ttst_lock.run \ 459 basic-tls-fetch_add.run 460 461 CTXSWITCH_DEPEND = ctxswitch-cfa_generator.run \ 462 ctxswitch-cfa_coroutine.run ctxswitch-cfa_thread.run \ 463 ctxswitch-cfa_thread2.run ctxswitch-upp_coroutine.run \ 464 ctxswitch-upp_thread.run ctxswitch-python_coroutine.run \ 465 ctxswitch-nodejs_coroutine.run ctxswitch-nodejs_await.run \ 466 ctxswitch-goroutine_thread.run ctxswitch-rust_thread.run \ 467 ctxswitch-nodejs_coroutine.run ctxswitch-java_thread.run \ 468 ctxswitch-pthread.run $(am__append_1) 416 469 testdir = $(top_srcdir)/tests 417 470 all: all-am … … 732 785 733 786 dummyC.c: 734 @echo "int main() { return 0; }" > ${@}787 echo "int main() { return 0; }" > ${@} 735 788 736 789 dummyCXX.cpp: 737 @echo "int main() { return 0; }" > ${@} 738 790 echo "int main() { return 0; }" > ${@} 791 792 .SILENT: # do not print recipe 739 793 .NOTPARALLEL: 740 .PHONY: compile.csv ctxswitch.csv mutex.csv signal.csv741 742 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)794 .PHONY: jenkins cleancsv 795 796 all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) schedint$(EXEEXT) schedext$(EXEEXT) creation$(EXEEXT) 743 797 744 798 %.run : %$(EXEEXT) ${REPEAT} 745 @rm -f .result.log 746 @echo "------------------------------------------------------" 747 @echo $< 748 @${REPEAT} ${repeats} ./a.out | tee -a .result.log 749 @${STATS} .result.log 750 @echo "------------------------------------------------------" 751 @rm -f a.out .result.log *.class 799 rm -f .result.log 800 echo "------------------------------------------------------" 801 echo $< 802 ${REPEAT} ${repeats} -- ./a.out\ 803 $(if ${$(subst -,_,$(basename $@))_DURATION},\ 804 ${$(subst -,_,$(basename $@))_DURATION},\ 805 ${$(firstword $(subst -, ,$(basename $@)))_DURATION}) | tee -a .result.log 806 ${STATS} .result.log 807 echo "------------------------------------------------------" 808 rm -f a.out .result.log *.class 809 810 # ${REPEAT} ${repeats} -- /usr/bin/time -f "%Uu %Ss %Er %Mkb" ./a.out 752 811 753 812 %.runquiet : 754 @+make $(basename $@) CFLAGS="-w" __quiet=quiet755 @taskset -c 1 ./a.out756 @rm -f a.out813 +make $(basename $@) CFLAGS="-w" __quiet=quiet 814 taskset -c 1 ./a.out 815 rm -f a.out 757 816 758 817 %.make : 759 @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@))760 @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1818 printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@)) 819 +/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1 761 820 762 821 ${REPEAT} : 763 @+make -C ${abs_top_builddir}/tools repeat 764 765 jenkins$(EXEEXT): 822 +make -C ${abs_top_builddir}/tools repeat 823 824 cleancsv: 825 rm -f compile.csv basic.csv ctxswitch.csv mutex.csv scheduling.csv 826 827 jenkins$(EXEEXT): cleancsv 766 828 @DOifskipcompile@ 767 @+make compile.csv768 @-+make compile.diff.csv829 +make compile.csv 830 -+make compile.diff.csv 769 831 @DOendif@ 770 @+make ctxswitch.csv771 @-+make ctxswitch.diff.csv772 @+make mutex.csv773 @-+make mutex.diff.csv774 @+make signal.csv775 @-+make signal.diff.csv832 +make ctxswitch.csv 833 -+make ctxswitch.diff.csv 834 +make mutex.csv 835 -+make mutex.diff.csv 836 +make scheduling.csv 837 -+make scheduling.diff.csv 776 838 @DOifskipcompile@ 777 839 cat compile.csv … … 782 844 cat mutex.csv 783 845 -cat mutex.diff.csv 784 cat s ignal.csv785 -cat s ignal.diff.csv846 cat scheduling.csv 847 -cat scheduling.diff.csv 786 848 787 849 compile.csv: 788 @echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@ 789 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@ 790 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@ 791 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@ 792 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@ 793 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@ 794 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@ 795 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@ 796 @+make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@ 797 @$(srcdir)/fixcsv.sh $@ 850 echo "building $@" 851 echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@ 852 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@ 853 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@ 854 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@ 855 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@ 856 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@ 857 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@ 858 +make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@ 859 +make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@ 860 $(srcdir)/fixcsv.sh $@ 798 861 799 862 ctxswitch.csv: 800 @echo "generator,coroutine,thread" > $@ 801 @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@ 802 @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@ 803 @+make ctxswitch-cfa_thread.runquiet >> $@ 804 @$(srcdir)/fixcsv.sh $@ 863 echo "building $@" 864 echo "generator,coroutine,thread" > $@ 865 +make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@ 866 +make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@ 867 +make ctxswitch-cfa_thread.runquiet >> $@ 868 $(srcdir)/fixcsv.sh $@ 805 869 806 870 mutex.csv: 807 @echo "1-monitor,2-monitor" > $@ 808 @+make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@ 809 @+make mutex-cfa2.runquiet >> $@ 810 @$(srcdir)/fixcsv.sh $@ 811 812 signal.csv: 813 @echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@ 814 @+make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@ 815 @+make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@ 816 @+make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@ 817 @+make waitfor-cfa2.runquiet >> $@ 818 @$(srcdir)/fixcsv.sh $@ 871 echo "building $@" 872 echo "1-monitor,2-monitor" > $@ 873 +make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@ 874 +make mutex-cfa2.runquiet >> $@ 875 $(srcdir)/fixcsv.sh $@ 876 877 scheduling.csv: 878 echo "building $@" 879 echo "schedint-1,schedint-2,schedext-1,schedext-2" > $@ 880 +make schedint-cfa1.runquiet >> $@ && echo -n ',' >> $@ 881 +make schedint-cfa2.runquiet >> $@ && echo -n ',' >> $@ 882 +make schedext-cfa1.runquiet >> $@ && echo -n ',' >> $@ 883 +make schedext-cfa2.runquiet >> $@ 884 $(srcdir)/fixcsv.sh $@ 819 885 820 886 %.diff.csv: %.csv 821 @test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false) 822 @$(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@ 823 824 loop$(EXEEXT): 825 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c 826 827 function$(EXEEXT): 828 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c 829 830 fetch_add$(EXEEXT): 831 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c 832 833 ttst_lock$(EXEEXT): 834 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/ttst_lock.c 835 836 tls-fetch_add$(EXEEXT): 837 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/tls-fetch_add.c 887 test -e $(srcdir)/baselines/$(arch)/$< || (echo "Error : Missing baseline for ${<}" && false) 888 $(srcdir)/baselines/calc.py $(srcdir)/baselines/$(arch)/$(<) $(<) > $@ 889 890 basic-loop$(EXEEXT): 891 $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/loop.c 892 893 basic-function$(EXEEXT): 894 $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/function.c 895 896 basic-fetch_add$(EXEEXT): 897 $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/fetch_add.c 898 899 basic-ttst_lock$(EXEEXT): 900 $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/ttst_lock.c 901 902 basic-tls-fetch_add$(EXEEXT): 903 $(BENCH_V_CC)$(COMPILE) $(srcdir)/basic/tls_fetch_add.c 904 905 basic$(EXEEXT): $(BASIC_DEPEND) 838 906 839 907 @WITH_LIBFIBRE_TRUE@ctxswitch-kos_fibre$(EXEEXT): … … 845 913 ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) 846 914 847 ctxswitch-pthread$(EXEEXT):848 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c849 850 915 ctxswitch-cfa_generator$(EXEEXT): 851 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000$(srcdir)/ctxswitch/cfa_gen.cfa916 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_gen.cfa 852 917 853 918 ctxswitch-cfa_coroutine$(EXEEXT): 854 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000$(srcdir)/ctxswitch/cfa_cor.cfa919 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_cor.cfa 855 920 856 921 ctxswitch-cfa_thread$(EXEEXT): 857 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000$(srcdir)/ctxswitch/cfa_thrd.cfa922 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd.cfa 858 923 859 924 ctxswitch-cfa_thread2$(EXEEXT): 860 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000$(srcdir)/ctxswitch/cfa_thrd2.cfa925 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/ctxswitch/cfa_thrd2.cfa 861 926 862 927 ctxswitch-upp_coroutine$(EXEEXT): 863 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000$(srcdir)/ctxswitch/upp_cor.cc928 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_cor.cc 864 929 865 930 ctxswitch-upp_thread$(EXEEXT): 866 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc 867 868 ctxswitch-goroutine$(EXEEXT): 931 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/ctxswitch/upp_thrd.cc 932 933 ctxswitch-python_coroutine$(EXEEXT): 934 $(BENCH_V_PY)echo "#!/bin/sh" > a.out 935 echo "python3.7 $(srcdir)/ctxswitch/python_cor.py" >> a.out 936 chmod a+x a.out 937 938 ctxswitch-nodejs_coroutine$(EXEEXT): 939 $(BENCH_V_NODEJS)echo "#!/bin/sh" > a.out 940 echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out 941 chmod a+x a.out 942 943 ctxswitch-nodejs_await$(EXEEXT): 944 $(BENCH_V_NODEJS)echo "#!/bin/sh" > a.out 945 echo "nodejs $(srcdir)/ctxswitch/node_await.js" >> a.out 946 chmod a+x a.out 947 948 ctxswitch-goroutine_thread$(EXEEXT): 869 949 $(BENCH_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go 950 951 ctxswitch-rust_thread$(EXEEXT): 952 $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/ctxswitch/rust_thrd.rs 870 953 871 954 ctxswitch-java_thread$(EXEEXT): 872 955 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java 873 @echo "#!/bin/sh" > a.out 874 @echo "java JavaThread" >> a.out 875 @chmod a+x a.out 876 877 mutex$(EXEEXT) :\ 878 loop.run \ 879 function.run \ 880 fetch_add.run \ 881 mutex-pthread_lock.run \ 882 mutex-upp.run \ 956 echo "#!/bin/sh" > a.out 957 echo "java JavaThread" >> a.out 958 chmod a+x a.out 959 960 ctxswitch-pthread$(EXEEXT): 961 $(BENCH_V_CC)$(COMPILE) $(srcdir)/ctxswitch/pthreads.c 962 963 mutex$(EXEEXT) : \ 883 964 mutex-cfa1.run \ 884 965 mutex-cfa2.run \ 885 966 mutex-cfa4.run \ 886 mutex-java_thread.run 887 888 mutex-pthread_lock$(EXEEXT): 889 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c 967 mutex-upp.run \ 968 mutex-go.run \ 969 mutex-rust.run \ 970 mutex-java.run \ 971 mutex-pthread.run 972 973 mutex-pthread$(EXEEXT): 974 $(BENCH_V_CC)$(COMPILE) $(srcdir)/mutex/pthreads.c 975 976 mutex-cfa1$(EXEEXT): 977 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa1.cfa 978 979 mutex-cfa2$(EXEEXT): 980 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa2.cfa 981 982 mutex-cfa4$(EXEEXT): 983 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutex/cfa4.cfa 890 984 891 985 mutex-upp$(EXEEXT): 892 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc 893 894 mutex-cfa1$(EXEEXT): 895 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.cfa 896 897 mutex-cfa2$(EXEEXT): 898 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.cfa 899 900 mutex-cfa4$(EXEEXT): 901 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.cfa 902 903 mutex-java_thread$(EXEEXT): 986 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/mutex/upp.cc 987 988 mutex-go$(EXEEXT): 989 $(BENCH_V_GOC)go build -o a.out $(srcdir)/mutex/goroutine.go 990 991 mutex-rust$(EXEEXT): 992 $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/mutex/rust.rs 993 994 mutex-java$(EXEEXT): 904 995 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java 905 @echo "#!/bin/sh" > a.out 906 @echo "java JavaThread" >> a.out 907 @chmod a+x a.out 908 909 signal$(EXEEXT) :\ 910 signal-pthread_cond.run \ 911 signal-upp.run \ 912 signal-cfa1.run \ 913 signal-cfa2.run \ 914 signal-cfa4.run \ 915 signal-java_thread.run 916 917 signal-pthread_cond$(EXEEXT): 918 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c 919 920 signal-upp$(EXEEXT): 921 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc 922 923 signal-cfa1$(EXEEXT): 924 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.cfa 925 926 signal-cfa2$(EXEEXT): 927 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.cfa 928 929 signal-cfa4$(EXEEXT): 930 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.cfa 931 932 signal-java_thread$(EXEEXT): 996 echo "#!/bin/sh" > a.out 997 echo "java JavaThread" >> a.out 998 chmod a+x a.out 999 1000 schedint$(EXEEXT) : \ 1001 schedint-cfa1.run \ 1002 schedint-cfa2.run \ 1003 schedint-cfa4.run \ 1004 schedint-upp.run \ 1005 schedint-rust.run \ 1006 schedint-java.run \ 1007 schedint-pthread.run 1008 1009 schedint-cfa1$(EXEEXT): 1010 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa 1011 1012 schedint-cfa2$(EXEEXT): 1013 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa 1014 1015 schedint-cfa4$(EXEEXT): 1016 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa 1017 1018 schedint-upp$(EXEEXT): 1019 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc 1020 1021 schedint-rust$(EXEEXT): 1022 $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs 1023 1024 schedint-java$(EXEEXT): 933 1025 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java 934 @echo "#!/bin/sh" > a.out 935 @echo "java JavaThread" >> a.out 936 @chmod a+x a.out 937 938 waitfor$(EXEEXT) :\ 939 waitfor-upp.run \ 940 waitfor-cfa1.run \ 941 waitfor-cfa2.run \ 942 waitfor-cfa4.run 943 944 waitfor-upp$(EXEEXT): 945 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc 946 947 waitfor-cfa1$(EXEEXT): 948 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.cfa 949 950 waitfor-cfa2$(EXEEXT): 951 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.cfa 952 953 waitfor-cfa4$(EXEEXT): 954 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.cfa 955 956 creation$(EXEEXT) :\ 957 creation-pthread.run \ 1026 echo "#!/bin/sh" > a.out 1027 echo "java JavaThread" >> a.out 1028 chmod a+x a.out 1029 1030 schedint-pthread$(EXEEXT): 1031 $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c 1032 1033 schedext$(EXEEXT) : \ 1034 schedext-cfa1.run \ 1035 schedext-cfa2.run \ 1036 schedext-cfa4.run \ 1037 schedext-upp.run \ 1038 schedext-goroutine.run 1039 1040 schedext-cfa1$(EXEEXT): 1041 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa 1042 1043 schedext-cfa2$(EXEEXT): 1044 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa 1045 1046 schedext-cfa4$(EXEEXT): 1047 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa 1048 1049 schedext-upp$(EXEEXT): 1050 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc 1051 1052 schedext-goroutine$(EXEEXT): 1053 $(BENCH_V_GOC)go build -o a.out $(srcdir)/schedext/goroutine.go 1054 1055 creation$(EXEEXT) : \ 1056 creation-cfa_generator.run \ 958 1057 creation-cfa_coroutine.run \ 959 1058 creation-cfa_coroutine_eager.run \ … … 961 1060 creation-upp_coroutine.run \ 962 1061 creation-upp_thread.run \ 963 creation-goroutine.run \ 964 creation-java_thread.run 1062 creation-python_coroutine.run \ 1063 creation-nodejs_coroutine.run \ 1064 creation-goroutine_thread.run \ 1065 creation-rust_thread.run \ 1066 creation-java_thread.run \ 1067 creation-pthread.run 1068 1069 creation-cfa_generator$(EXEEXT): 1070 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_gen.cfa 965 1071 966 1072 creation-cfa_coroutine$(EXEEXT): 967 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000$(srcdir)/creation/cfa_cor.cfa1073 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa 968 1074 969 1075 creation-cfa_coroutine_eager$(EXEEXT): 970 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000$(srcdir)/creation/cfa_cor.cfa -DEAGER1076 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa -DEAGER 971 1077 972 1078 creation-cfa_thread$(EXEEXT): 973 $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000$(srcdir)/creation/cfa_thrd.cfa1079 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_thrd.cfa 974 1080 975 1081 creation-upp_coroutine$(EXEEXT): 976 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000$(srcdir)/creation/upp_cor.cc1082 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_cor.cc 977 1083 978 1084 creation-upp_thread$(EXEEXT): 979 $(BENCH_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc 980 981 creation-pthread$(EXEEXT): 982 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c 983 984 creation-goroutine$(EXEEXT): 1085 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/creation/upp_thrd.cc 1086 1087 creation-python_coroutine$(EXEEXT): 1088 $(BENCH_V_PY)echo "#!/bin/sh" > a.out 1089 echo "python3.7 $(srcdir)/creation/python_cor.py" >> a.out 1090 chmod a+x a.out 1091 1092 creation-nodejs_coroutine$(EXEEXT): 1093 $(BENCH_V_NODEJS)echo "#!/bin/sh" > a.out 1094 echo "nodejs $(srcdir)/creation/node_cor.js" >> a.out 1095 chmod a+x a.out 1096 1097 creation-goroutine_thread$(EXEEXT): 985 1098 $(BENCH_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go 1099 1100 creation-rust_thread$(EXEEXT): 1101 $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs 986 1102 987 1103 creation-java_thread$(EXEEXT): 988 1104 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java 989 @echo "#!/bin/sh" > a.out 990 @echo "java JavaThread" >> a.out 991 @chmod a+x a.out 992 993 compile$(EXEEXT) :\ 1105 echo "#!/bin/sh" > a.out 1106 echo "java JavaThread" >> a.out 1107 chmod a+x a.out 1108 1109 creation-pthread$(EXEEXT): 1110 $(BENCH_V_CC)$(COMPILE) $(srcdir)/creation/pthreads.c 1111 1112 compile$(EXEEXT) : \ 994 1113 compile-array.make \ 995 1114 compile-attributes.make \ … … 1002 1121 1003 1122 compile-array$(EXEEXT): 1004 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa1123 $(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa 1005 1124 1006 1125 compile-attributes$(EXEEXT): 1007 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa1126 $(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa 1008 1127 1009 1128 compile-empty$(EXEEXT): 1010 @$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa1129 $(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa 1011 1130 1012 1131 compile-expression$(EXEEXT): 1013 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa1132 $(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa 1014 1133 1015 1134 compile-io$(EXEEXT): 1016 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa1135 $(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa 1017 1136 1018 1137 compile-monitor$(EXEEXT): 1019 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa1138 $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa 1020 1139 1021 1140 compile-operators$(EXEEXT): 1022 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa1141 $(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa 1023 1142 1024 1143 compile-thread$(EXEEXT): 1025 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa1144 $(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa 1026 1145 1027 1146 compile-typeof$(EXEEXT): 1028 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa1147 $(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa 1029 1148 1030 1149 # Tell versions [3.59,3.63) of GNU make to not export all variables. -
benchmark/baselines/x64/schedint.csv
rdca5802 rb7d6a36 1 waitfor-2,signal-1,signal-2,waitfor-11 schedext-2,schedint-1,schedint-2,schedext-1 2 2 393.69606249999987,325.99158333333327,409.01025000000004,319.90975000000003 -
benchmark/baselines/x86/schedint.csv
rdca5802 rb7d6a36 1 s ignal-2,waitfor-1,waitfor-2,signal-11 schedint-2,schedext-1,schedext-2,schedint-1 2 2 532.5297959183672,413.3084897959184,506.7579591836735,423.78826530612247 -
benchmark/basic/tls_fetch_add.c
rdca5802 rb7d6a36 3 3 4 4 #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. 5 8 6 9 #define thread_local _Thread_local … … 16 19 } 17 20 18 int main(int argc, char* argv[]) { 21 int main( int argc, char * argv[] ) { 22 BENCH_START() 19 23 BENCH( 20 for (size_t i = 0; i < n; i++) {24 for (size_t i = 0; i < times; i++) { 21 25 do_call(); 22 26 }, 23 27 result 24 28 ) 29 printf( "%g\n", result ); 30 } 25 31 26 printf("%g\n", result); 27 } 32 // Local Variables: // 33 // tab-width: 4 // 34 // End: // -
benchmark/basic/ttst_lock.c
rdca5802 rb7d6a36 3 3 4 4 #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. 5 8 6 9 #define CALIGN __attribute__(( aligned (CACHE_ALIGN) )) … … 35 38 } 36 39 37 int main(int argc, char* argv[]) { 40 int main( int argc, char * argv[] ) { 41 BENCH_START() 38 42 BENCH( 39 for (size_t i = 0; i < n; i++) {43 for (size_t i = 0; i < times; i++) { 40 44 do_call(); 41 45 }, 42 46 result 43 ) 44 45 printf("%g\n", result); 47 ) 48 printf( "%g\n", result ); 46 49 } 47 50 -
benchmark/bench.h
rdca5802 rb7d6a36 5 5 #endif 6 6 #include <stdlib.h> 7 #include <unistd.h> // sysconf 7 #include <stdint.h> // uint64_t 8 #include <unistd.h> // sysconf 8 9 #if ! defined(__cforall) 9 10 #include <time.h> … … 15 16 16 17 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 18 static 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 32 23 33 24 #ifndef BENCH_N 34 #define BENCH_N 500 //1000000025 #define BENCH_N 10000000 35 26 #endif 36 27 28 size_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 37 36 #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; \ 44 38 StartTime = bench_time(); \ 45 statement; \39 statement; \ 46 40 EndTime = bench_time(); \ 47 double output = \48 (double)( EndTime - StartTime ) / n; 41 double output = (double)( EndTime - StartTime ) / times; 42 49 43 50 44 #if defined(__cforall) … … 53 47 } 54 48 #endif 49 #if defined(__U_CPLUSPLUS__) 50 unsigned int uDefaultPreemption() { 51 return 0; 52 } 53 #endif -
benchmark/creation/JavaThread.java
rdca5802 rb7d6a36 26 26 static int x = 2; 27 27 28 static private final int NoOfTimes = Integer.parseInt("10000") ;28 static private int times = Integer.parseInt("10000") ; 29 29 30 30 public static class MyThread extends Thread { … … 33 33 } 34 34 public static void helper() throws InterruptedException { 35 for(int i = 1; i <= NoOfTimes; i += 1) {35 for(int i = 1; i <= times; i += 1) { 36 36 MyThread m = new MyThread(); 37 37 x = nextRandom( x ); … … 44 44 helper(); 45 45 long end = System.nanoTime(); 46 System.out.println( (end - start) / NoOfTimes );46 System.out.println( (end - start) / times ); 47 47 } 48 48 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 ; ) { 50 53 InnerMain(); 51 Thread.sleep(2000); // 2 seconds54 Thread.sleep(2000); // 2 seconds 52 55 x = nextRandom(x); 53 56 } … … 55 58 } 56 59 } 60 61 // Local Variables: // 62 // tab-width: 4 // 63 // End: // -
benchmark/creation/cfa_cor.cfa
rdca5802 rb7d6a36 5 5 6 6 coroutine MyCoroutine {}; 7 void ?{} (MyCoroutine & this) {7 void ?{}( MyCoroutine & this ) { 8 8 #ifdef EAGER 9 resume( this);9 resume( this ); 10 10 #endif 11 11 } 12 void main( MyCoroutine &) {}12 void main( MyCoroutine & ) {} 13 13 14 int main(int argc, char* argv[]) { 14 int main( int argc, char * argv[] ) { 15 BENCH_START() 15 16 BENCH( 16 for ( i; n) {17 MyCoroutine m;17 for ( times ) { 18 MyCoroutine c; 18 19 }, 19 20 result 20 21 ) 22 printf( "%g\n", result ); 23 } 21 24 22 printf("%g\n", result); 23 } 25 // Local Variables: // 26 // tab-width: 4 // 27 // End: // -
benchmark/creation/cfa_thrd.cfa
rdca5802 rb7d6a36 7 7 void main(MyThread &) {} 8 8 9 int main(int argc, char* argv[]) { 9 int main( int argc, char * argv[] ) { 10 BENCH_START() 10 11 BENCH( 11 for ( i; n) {12 for ( times ) { 12 13 MyThread m; 13 14 }, 14 15 result 15 16 ) 17 printf( "%g\n", result ); 18 } 16 19 17 printf("%g\n", result); 18 } 20 // Local Variables: // 21 // tab-width: 4 // 22 // End: // -
benchmark/creation/goroutine.go
rdca5802 rb7d6a36 2 2 3 3 import ( 4 "fmt" 5 "time" 4 "fmt" 5 "time" 6 "os" 7 "strconv" 6 8 ) 7 9 … … 17 19 18 20 func 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 20 25 start := time.Now() 21 for i := 1; i <= NoOfTimes; i += 1 {26 for i := 1; i <= times; i += 1 { 22 27 go noop() // creation 28 <- shake // wait for completion 23 29 } 24 30 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) ) 27 32 } 33 34 // Local Variables: // 35 // tab-width: 4 // 36 // End: // -
benchmark/creation/pthreads.c
rdca5802 rb7d6a36 4 4 #include "bench.h" 5 5 6 static void * foo(void *arg) {6 static void * foo(void *arg) { 7 7 return arg; 8 8 } 9 9 10 int main(int argc, char* argv[]) { 10 int main( int argc, char * argv[] ) { 11 BENCH_START() 11 12 BENCH( 12 for (size_t i = 0; i < n; i++) {13 for (size_t i = 0; i < times; i++) { 13 14 pthread_t thread; 14 15 if (pthread_create(&thread, NULL, foo, NULL) < 0) { … … 16 17 return 1; 17 18 } 18 19 19 if (pthread_join( thread, NULL) < 0) { 20 20 perror( "failure" ); … … 24 24 result 25 25 ) 26 printf( "%g\n", result ); 27 } 26 28 27 printf("%g\n", result); 28 } 29 // Local Variables: // 30 // tab-width: 4 // 31 // End: // -
benchmark/creation/upp_cor.cc
rdca5802 rb7d6a36 5 5 _Coroutine MyCor { 6 6 void main() {} 7 public: 8 MyCor() { resume(); } 7 9 }; 8 10 9 int main(int argc, char* argv[]) { 11 int main( int argc, char * argv[] ) { 12 BENCH_START() 10 13 BENCH( 11 for (size_t i = 0; i < n; i++) {14 for (size_t i = 0; i < times; i++) { 12 15 MyCor m; 13 16 }, 14 17 result 15 18 ) 19 printf( "%g\n", result ); 20 } 16 21 17 printf("%g\n", result); 18 } 22 // Local Variables: // 23 // tab-width: 4 // 24 // End: // -
benchmark/creation/upp_thrd.cc
rdca5802 rb7d6a36 7 7 }; 8 8 9 int main(int argc, char* argv[]) { 9 int main( int argc, char * argv[] ) { 10 BENCH_START() 10 11 BENCH( 11 for (size_t i = 0; i < n; i++) {12 for (size_t i = 0; i < times; i++) { 12 13 MyThread m; 13 14 }, 14 15 result 15 16 ) 17 printf( "%g\n", result ); 18 } 16 19 17 printf("%g\n", result); 18 } 20 // Local Variables: // 21 // tab-width: 4 // 22 // End: // -
benchmark/ctxswitch/JavaThread.java
rdca5802 rb7d6a36 26 26 static int x = 2; 27 27 28 static private final int NoOfTimes = Integer.parseInt("1000000");28 static private int times = Integer.parseInt("100000"); 29 29 30 30 public static void helper() { 31 for(int i = 1; i <= NoOfTimes; i += 1) {31 for(int i = 1; i <= times; i += 1) { 32 32 Thread.yield(); 33 33 } … … 37 37 helper(); 38 38 long end = System.nanoTime(); 39 System.out.println( (end - start) / NoOfTimes );39 System.out.println( (end - start) / times ); 40 40 } 41 41 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 ; ) { 43 46 InnerMain(); 44 Thread.sleep(2000); // 2 seconds47 Thread.sleep(2000); // 2 seconds 45 48 x = nextRandom(x); 46 49 } … … 48 51 } 49 52 } 53 54 // Local Variables: // 55 // tab-width: 4 // 56 // End: // -
benchmark/ctxswitch/cfa_cor.cfa
rdca5802 rb7d6a36 4 4 #include "bench.h" 5 5 6 coroutine GreatSuspender {}; 7 8 void ?{}( GreatSuspender & this ) { 9 prime(this); 10 } 11 12 void main( __attribute__((unused)) GreatSuspender & this ) { 13 while( true ) { 6 coroutine C {} c; 7 void main( __attribute__((unused)) C & ) { 8 while () { 14 9 suspend(); 15 10 } 16 11 } 17 18 int main(int argc, char* argv[]) { 19 GreatSuspender s; 20 12 int main( int argc, char * argv[] ) { 13 BENCH_START() 21 14 BENCH( 22 for ( i; n) {23 resume( s);15 for ( times ) { 16 resume( c ); 24 17 }, 25 18 result 26 19 ) 20 printf( "%g\n", result ); 21 } 27 22 28 printf("%g\n", result); 29 } 23 // Local Variables: // 24 // tab-width: 4 // 25 // End: // -
benchmark/ctxswitch/cfa_cor_then.cfa
rdca5802 rb7d6a36 6 6 void noOp(void) {} 7 7 8 coroutine GreatSuspender {};8 coroutine C {} c; 9 9 10 void ?{}( GreatSuspender& this ) {10 void ?{}( C & this ) { 11 11 prime(this); 12 12 } 13 13 14 void main( __attribute__((unused)) GreatSuspender& this ) {15 while ( true) {14 void main( __attribute__((unused)) C & this ) { 15 while () { 16 16 suspend_then(noOp); 17 17 } 18 18 } 19 19 20 int main(int argc, char* argv[]) { 21 GreatSuspender s; 22 20 int main( int argc, char * argv[] ) { 21 BENCH_START() 23 22 BENCH( 24 for ( i; n) {25 resume( s);23 for ( times ) { 24 resume( c ); 26 25 }, 27 26 result 28 27 ) 28 printf( "%g\n", result ); 29 } 29 30 30 printf("%g\n", result); 31 } 31 // Local Variables: // 32 // tab-width: 4 // 33 // End: // -
benchmark/ctxswitch/cfa_gen.cfa
rdca5802 rb7d6a36 3 3 typedef struct { 4 4 void * next; 5 } GreatSuspender;5 } C; 6 6 7 void comain( GreatSuspender * this) {8 if ( __builtin_expect(this->next != 0, 1) ) goto *(this->next);9 this->next = &&s1;7 void comain( C * c ) { 8 if ( __builtin_expect(c->next != 0, 1) ) goto *(c->next); 9 c->next = &&s1; 10 10 for () { 11 return;11 return; 12 12 s1: ; 13 13 } 14 14 } 15 15 16 int main( int argc, char* argv[]) {17 GreatSuspender s = { 0 }; 18 16 int main( int argc, char * argv[] ) { 17 BENCH_START() 18 C c = { 0 }; 19 19 BENCH( 20 for ( i; n) {21 comain( & s);20 for ( times ) { 21 comain( &c ); 22 22 }, 23 23 result 24 24 ) 25 printf( "%g\n", result ); 26 } 25 27 26 printf("%g\n", result); 27 } 28 // Local Variables: // 29 // tab-width: 4 // 30 // End: // -
benchmark/ctxswitch/cfa_thrd.cfa
rdca5802 rb7d6a36 3 3 #include "bench.h" 4 4 5 int main(int argc, char* argv[]) { 5 int main( int argc, char * argv[] ) { 6 BENCH_START() 6 7 BENCH( 7 for ( i; n) {8 for ( times ) { 8 9 yield(); 9 10 }, 10 11 result 11 12 ) 13 printf( "%g\n", result ); 14 } 12 15 13 printf("%g\n", result); 14 } 16 // Local Variables: // 17 // tab-width: 4 // 18 // End: // -
benchmark/ctxswitch/cfa_thrd2.cfa
rdca5802 rb7d6a36 8 8 9 9 void main(__attribute__((unused)) Fibre & this) { 10 while (!done) {10 while ( ! done ) { 11 11 yield(); 12 12 } 13 13 } 14 14 15 int main(int argc, char* argv[]) { 15 int main( int argc, char * argv[] ) { 16 BENCH_START() 16 17 Fibre f1; 17 18 BENCH( 18 for ( i; n) {19 for ( times ) { 19 20 yield(); 20 21 }, 21 22 result 22 23 ) 24 printf( "%g\n", result ); 25 done = true; 26 } 23 27 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
rdca5802 rb7d6a36 2 2 3 3 import ( 4 "fmt" 5 "runtime" 6 "time" 4 "fmt" 5 "time" 6 "os" 7 "strconv" 8 "runtime" 7 9 ) 8 10 … … 28 30 29 31 func 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 32 36 <- shake 33 37 } 38 39 // Local Variables: // 40 // tab-width: 4 // 41 // End: // -
benchmark/ctxswitch/kos_fibre.cpp
rdca5802 rb7d6a36 3 3 #include "bench.h" 4 4 5 int main(int argc, char* argv[]) { 5 int main( int argc, char * argv[] ) { 6 BENCH_START() 6 7 BENCH( 7 for (size_t i = 0; i < n; i++) {8 for (size_t i = 0; i < times; i++) { 8 9 Fibre::yield(); 9 10 }, 10 11 result 11 12 ) 12 printf("%g\n", result); 13 return 0; 13 printf( "%g\n", result ); 14 14 } 15 16 // Local Variables: // 17 // tab-width: 4 // 18 // End: // -
benchmark/ctxswitch/kos_fibre2.cpp
rdca5802 rb7d6a36 11 11 } 12 12 13 int main(int argc, char* argv[]) { 13 int main( int argc, char * argv[] ) { 14 BENCH_START() 14 15 Fibre* f1 = (new Fibre)->run(f1main); 15 16 BENCH( 16 for (size_t i = 0; i < n; i++) {17 for (size_t i = 0; i < times; i++) { 17 18 Fibre::yield(); 18 19 }, 19 20 result 20 21 ) 21 printf( "%g\n", result);22 printf( "%g\n", result ); 22 23 done = true; 23 24 Fibre::yield(); 24 25 f1->join(); 25 return 0;26 26 } 27 28 // Local Variables: // 29 // tab-width: 4 // 30 // End: // -
benchmark/ctxswitch/pthreads.c
rdca5802 rb7d6a36 6 6 #include "bench.h" 7 7 8 int main(int argc, char* argv[]) { 8 int main( int argc, char * argv[] ) { 9 BENCH_START() 9 10 BENCH( 10 for (size_t i = 0; i < n; i++) {11 for (size_t i = 0; i < times; i++) { 11 12 sched_yield(); 12 13 }, 13 14 result 14 15 ) 15 16 printf("%g\n", result); 16 printf( "%g\n", result ); 17 17 } -
benchmark/ctxswitch/upp_cor.cc
rdca5802 rb7d6a36 3 3 #include "bench.h" 4 4 5 _Coroutine GreatSuspender { 6 public: 7 GreatSuspender() { 8 resume(); 9 } 10 11 void do_resume() { 12 resume(); 13 } 14 private: 5 _Coroutine C { 15 6 void main() { 16 7 while( true ) { … … 18 9 } 19 10 } 20 }; 21 22 int main(int argc, char* argv[]) { 23 GreatSuspender s; 24 11 public: 12 void do_resume() { 13 resume(); 14 } 15 } c; 16 int main( int argc, char * argv[] ) { 17 BENCH_START() 25 18 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(); 28 21 }, 29 22 result 30 23 ) 24 printf( "%g\n", result ); 25 } 31 26 32 printf("%g\n", result); 33 } 27 // Local Variables: // 28 // tab-width: 4 // 29 // End: // -
benchmark/ctxswitch/upp_thrd.cc
rdca5802 rb7d6a36 3 3 #include "bench.h" 4 4 5 int main(int argc, char* argv[]) { 5 int main( int argc, char * argv[] ) { 6 BENCH_START() 6 7 BENCH( 7 for (size_t i = 0; i < n; i++) {8 for (size_t i = 0; i < times; i++) { 8 9 uThisTask().yield(); 9 10 }, 10 11 result 11 12 ) 13 printf( "%g\n", result ); 14 } 12 15 13 printf("%g\n", result); 14 } 16 // Local Variables: // 17 // tab-width: 4 // 18 // End: // -
benchmark/mutex/JavaThread.java
rdca5802 rb7d6a36 26 26 static int x = 2; 27 27 28 static private final int NoOfTimes = Integer.parseInt("100000000");28 static private int times = Integer.parseInt("100000000"); 29 29 30 30 public synchronized void noop() { … … 35 35 // Inhibit biased locking ... 36 36 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) { 38 38 x = nextRandom(x); 39 39 j.noop(); … … 44 44 helper(); 45 45 long end = System.nanoTime(); 46 System.out.println( (end - start) / NoOfTimes );46 System.out.println( (end - start) / times ); 47 47 } 48 48 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 49 52 for (int n = Integer.parseInt("5"); --n >= 0 ; ) { 50 53 InnerMain(); … … 55 58 } 56 59 } 60 61 // Local Variables: // 62 // tab-width: 4 // 63 // End: // -
benchmark/mutex/cfa1.cfa
rdca5802 rb7d6a36 4 4 #include "bench.h" 5 5 6 monitor M {} ;7 void __attribute__((noinline)) call( M & mutex m) {}6 monitor M {} m1; 7 void __attribute__((noinline)) call( M & mutex p1 ) {} 8 8 9 int main( int argc, char* argv[]) {10 M m;9 int main( int argc, char * argv[] ) { 10 BENCH_START() 11 11 BENCH( 12 for ( i; n) {13 call( m);12 for ( times ) { 13 call( m1 ); 14 14 }, 15 15 result 16 16 ) 17 printf( "%g\n", result ); 18 } 17 19 18 printf("%g\n", result); 19 } 20 // Local Variables: // 21 // tab-width: 4 // 22 // End: // -
benchmark/mutex/cfa2.cfa
rdca5802 rb7d6a36 4 4 #include "bench.h" 5 5 6 monitor M {}; 7 void __attribute__((noinline)) call( M & mutex m1, M & mutex m2 ) {} 6 monitor M {} m1, m2; 8 7 9 int main(int argc, char* argv[]) { 10 M m1, m2; 8 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {} 9 10 int main( int argc, char * argv[] ) { 11 BENCH_START() 11 12 BENCH( 12 for ( i; n) {13 call( m1, m2);13 for ( times ) { 14 call( m1, m2 ); 14 15 }, 15 16 result 16 17 ) 18 printf( "%g\n", result ); 19 } 17 20 18 printf("%g\n", result); 19 } 21 // Local Variables: // 22 // tab-width: 4 // 23 // End: // -
benchmark/mutex/cfa4.cfa
rdca5802 rb7d6a36 5 5 6 6 7 monitor M {} ;8 void __attribute__((noinline)) call( M & mutex m1, M & mutex m2, M & mutex m3, M & mutex m4 ) {}7 monitor M {} m1, m2, m3, m4; 8 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {} 9 9 10 int main( int argc, char* argv[]) {11 M m1, m2, m3, m4;10 int main( int argc, char * argv[] ) { 11 BENCH_START() 12 12 BENCH( 13 for ( i; n) {14 call( m1, m2, m3, m4);13 for ( times ) { 14 call( m1, m2, m3, m4 ); 15 15 }, 16 16 result 17 17 ) 18 printf( "%g\n", result ); 19 } 18 20 19 printf("%g\n", result); 20 } 21 // Local Variables: // 22 // tab-width: 4 // 23 // End: // -
benchmark/mutex/pthreads.c
rdca5802 rb7d6a36 7 7 8 8 void __attribute__((noinline)) call() { 9 pthread_mutex_lock (&mutex);10 pthread_mutex_unlock( &mutex);9 pthread_mutex_lock( &mutex ); 10 pthread_mutex_unlock( &mutex ); 11 11 } 12 13 int main(int argc, char* argv[]) { 12 int main( int argc, char * argv[] ) { 13 BENCH_START() 14 14 BENCH( 15 for ( size_t i = 0; i < n; i++) {15 for ( size_t i = 0; i < times; i++ ) { 16 16 call(); 17 17 }, 18 18 result 19 19 ) 20 printf( "%g\n", result ); 21 } 20 22 21 printf("%g\n", result); 22 } 23 // Local Variables: // 24 // tab-width: 4 // 25 // End: // -
benchmark/mutex/upp.cc
rdca5802 rb7d6a36 8 8 }; 9 9 10 int main(int argc, char* argv[]) { 10 int main( int argc, char * argv[] ) { 11 BENCH_START() 11 12 MyMonitor m; 12 13 BENCH( 13 for ( size_t i = 0; i < n; i++) {14 for ( size_t i = 0; i < times; i++ ) { 14 15 m.call(); 15 16 }, 16 17 result 17 18 ) 19 printf( "%g\n", result ); 20 } 18 21 19 printf("%g\n", result); 20 } 22 // Local Variables: // 23 // tab-width: 4 // 24 // End: // -
benchmark/schedext/cfa1.cfa
rdca5802 rb7d6a36 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 int argc; 9 char** argv; 10 volatile int go = 0; 8 monitor M {} m1; 11 9 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; 10 void __attribute__((noinline)) call( M & mutex p1 ) {} 11 void __attribute__((noinline)) wait( M & mutex p1 ) { 12 for ( times ) { 13 waitfor( call : p1 ); 14 } 29 15 } 30 16 31 17 thread T {}; 32 void ^?{}( T & mutex this ) {}33 18 void 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 ); 37 24 } 38 25 39 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 26 int main( int argc, char * argv[] ) { 27 BENCH_START() 40 28 T t; 41 return wait(m1);29 wait( m1 ); 42 30 } 31 32 // Local Variables: // 33 // tab-width: 4 // 34 // End: // -
benchmark/schedext/cfa2.cfa
rdca5802 rb7d6a36 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 int argc; 9 char** argv; 10 volatile int go = 0; 8 monitor M {} m1, m2; 11 9 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; 10 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {} 11 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) { 12 for ( times ) { 13 waitfor( call : p1, p2 ); 14 } 15 } 16 thread T {}; 17 void main( T & ) { 19 18 BENCH( 20 for ( i; n) {21 waitfor(call, a1, a2);19 for ( times ) { 20 call( m1, m2 ); 22 21 }, 23 22 result 24 23 ) 25 26 printf("%g\n", result); 27 go = 0; 28 return 0; 24 printf( "%g\n", result ); 29 25 } 30 26 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 27 int main( int argc, char * argv[] ) { 28 BENCH_START() 29 T t; 30 wait( m1, m2 ); 37 31 } 38 32 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
rdca5802 rb7d6a36 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 int argc; 9 char** argv; 10 volatile int go = 0; 8 monitor M {} m1, m2, m3, m4; 11 9 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; 10 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {} 11 void __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 } 16 thread T {}; 17 void main( T & ) { 19 18 BENCH( 20 for ( i; n) {21 waitfor(call, a1, a2, a3, a4);19 for ( times ) { 20 call( m1, m2, m3, m4 ); 22 21 }, 23 22 result 24 23 ) 25 26 printf("%g\n", result); 27 go = 0; 28 return 0; 24 printf( "%g\n", result ); 29 25 } 30 26 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 27 int main( int argc, char * argv[] ) { 28 BENCH_START() 29 T t; 30 wait( m1, m2, m3, m4 ); 37 31 } 38 32 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
rdca5802 rb7d6a36 3 3 #include "bench.h" 4 4 5 int argc;6 char** argv;7 volatile int go = 0;8 9 5 _Monitor M { 10 6 public: 11 7 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; 12 14 13 int __attribute__((noinline)) wait(){14 go = 1;15 _Task T { 16 void main() { 15 17 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(); 18 20 }, 19 21 result 20 22 ) 21 22 printf("%g\n", result); 23 go = 0; 24 return 0; 23 printf( "%g\n", result ); 25 24 } 26 25 }; 27 26 28 M m; 27 int main( int argc, char * argv[] ) { 28 BENCH_START() 29 T t; 30 m.wait(); 31 } 29 32 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
rdca5802 rb7d6a36 49 49 static int x = 2; 50 50 51 static private final int NoOfTimes = Integer.parseInt("1000000");51 static private int times = Integer.parseInt("1000000"); 52 52 53 53 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) { 55 55 m.wait(); // relase monitor lock 56 56 m.next = true; … … 63 63 synchronized(m) { 64 64 s.start(); 65 while( ! Monitor.go ) {65 while( ! Monitor.go ) { // waiter must start first 66 66 Thread.yield(); 67 67 } … … 72 72 Monitor.go = false; 73 73 s.join(); 74 System.out.println( (end - start) / NoOfTimes);74 System.out.println( (end - start) / times); 75 75 } 76 76 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 77 80 for (int n = Integer.parseInt("5"); --n >= 0 ; ) { 78 81 InnerMain(); … … 83 86 } 84 87 } 88 89 // Local Variables: // 90 // tab-width: 4 // 91 // End: // -
benchmark/schedint/cfa1.cfa
rdca5802 rb7d6a36 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 int argc;9 char** argv;10 8 volatile int go = 0; 11 9 12 10 condition c; 13 monitor M {}; 14 M m1; 11 monitor M {} m1; 15 12 16 void __attribute__((noinline)) call( M & mutex a1 ) {17 signal( c);13 void __attribute__((noinline)) call( M & mutex p1 ) { 14 signal( c ); 18 15 } 19 20 int __attribute__((noinline)) wait( M & mutex a1 ) { 16 void __attribute__((noinline)) wait( M & mutex p1 ) { 21 17 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 } 32 21 } 33 22 34 23 thread T {}; 35 void ^?{}( T & mutex ) {}36 24 void 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 ); 40 31 } 41 32 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 33 int main( int argc, char * argv[] ) { 34 BENCH_START() 43 35 T t; 44 return wait(m1);36 wait( m1 ); 45 37 } 38 39 // Local Variables: // 40 // tab-width: 4 // 41 // End: // -
benchmark/schedint/cfa2.cfa
rdca5802 rb7d6a36 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 int argc;9 char** argv;10 8 volatile int go = 0; 11 9 12 10 condition c; 13 monitor M {}; 14 M m1, m2; 11 monitor M {} m1, m2; 15 12 16 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2 ) {17 signal( c);13 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) { 14 signal( c ); 18 15 } 19 20 int __attribute__((noinline)) wait( M & mutex a1, M & mutex a2 ) { 16 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) { 21 17 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 } 32 21 } 33 22 34 23 thread T {}; 35 void ^?{}( T & mutex this ) {}36 24 void 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 ); 40 31 } 41 32 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 33 int main( int argc, char * argv[] ) { 34 BENCH_START() 43 35 T t; 44 return wait(m1, m2);36 wait( m1, m2 ); 45 37 } 38 39 // Local Variables: // 40 // tab-width: 4 // 41 // End: // -
benchmark/schedint/cfa4.cfa
rdca5802 rb7d6a36 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 int argc;9 char** argv;10 8 volatile int go = 0; 11 9 12 10 condition c; 13 monitor M {}; 14 M m1, m2, m3, m4; 11 monitor M {} m1, m2, m3, m4; 15 12 16 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {17 signal( c);13 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) { 14 signal( c ); 18 15 } 19 20 int __attribute__((noinline)) wait( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) { 16 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) { 21 17 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 } 32 21 } 33 22 34 23 thread T {}; 35 void ^?{}( T & mutex this ) {}36 24 void 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 ); 40 31 } 41 32 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 33 int main( int argc, char * argv[] ) { 34 BENCH_START() 43 35 T t; 44 return wait(m1, m2, m3, m4);36 wait( m1, m2, m3, m4 ); 45 37 } 38 39 // Local Variables: // 40 // tab-width: 4 // 41 // End: // -
benchmark/schedint/pthreads.c
rdca5802 rb7d6a36 4 4 #include "bench.h" 5 5 6 int argc;7 char** argv;8 6 volatile int go = 0; 9 7 8 pthread_mutex_t m; 10 9 pthread_cond_t c; 11 pthread_mutex_t m;12 10 13 11 void __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 ); 17 15 } 18 16 19 int__attribute__((noinline)) wait() {17 void __attribute__((noinline)) wait() { 20 18 pthread_mutex_lock(&m); 21 19 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 27 void * 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 22 30 BENCH( 23 for (size_t i = 0; i < n; i++) { 24 pthread_cond_wait(&c, &m); 25 }, 31 while ( go == 1 ) { call(); }, 26 32 result 27 33 ) 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 ); 38 35 return NULL; 39 36 } 40 37 41 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 38 int main( int argc, char * argv[] ) { 39 BENCH_START() 42 40 pthread_t thread; 43 if ( pthread_create(&thread, NULL, thread_main, NULL) < 0) {41 if ( pthread_create( &thread, NULL, thread_main, NULL ) < 0 ) { 44 42 perror( "failure" ); 45 43 return 1; 46 44 } 47 45 wait(); 48 if ( pthread_join( thread, NULL) < 0) {46 if ( pthread_join( thread, NULL ) < 0 ) { 49 47 perror( "failure" ); 50 48 return 1; 51 49 } 52 return 0;53 50 } 51 52 // Local Variables: // 53 // tab-width: 4 // 54 // End: // -
benchmark/schedint/upp.cc
rdca5802 rb7d6a36 3 3 #include "bench.h" 4 4 5 int argc;6 char** argv;7 5 volatile int go = 0; 8 6 … … 13 11 cond.signal(); 14 12 } 13 void __attribute__((noinline)) wait() { 14 go = 1; 15 for ( size_t i = 0; i < times; i++ ) { 16 cond.wait(); 17 } 18 } 19 } m; 15 20 16 int __attribute__((noinline)) wait() { 17 go = 1; 21 _Task T { 22 void main() { 23 while ( go == 0 ) { yield(); } // waiter must start first 18 24 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(); 21 27 }, 22 28 result 23 29 ) 24 25 printf("%g\n", result); 26 go = 0; 27 return 0; 30 printf( "%g\n", result ); 28 31 } 29 32 }; 30 33 31 M m; 34 int main( int argc, char * argv[] ) { 35 BENCH_START() 36 T t; 37 m.wait(); 38 } 32 39 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.