This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby plot.rb hyperfine-reports/JS-total-showdown-v2.js | |
┌ ┐ | |
bun run ../ReMonkey/src/Benchmark.res.mjs ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 35.96237350322001 | |
node ../ReMonkey/src/Benchmark.res.mjs ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 18.156409287819997 | |
deno run ../ReMonkey/src/Benchmark.res.mjs ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 17.336384496119997 | |
bun run ../TSMonkey/benchmark.js ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 16.85066295362 | |
node ../TSMonkey/benchmark.js ┤■■■■■■■■■■■■■■■■■■■■ 11.24885970422 | |
./benchmarks-bun.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 32.26604655792 | |
./benchmarks-node.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 31.86506350702 | |
./benchmarks-deno.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hyperfine -w 3 -i 'bun run ../ReMonkey/src/Benchmark.res.mjs' 'node ../ReMonkey/src/Benchmark.res.mjs' 'deno run ../ReMonkey/src/Benchmark.res.mjs' 'bun run ../TSMonkey/benchmark.js' 'node ../TSMonkey/benchmark.js' './benchmarks-bun.sh eval-fast' './benchmarks-node.sh eval-fast' './benchmarks-deno.sh eval-fast' --export-json ../hyperfine-reports/JS-total-showdown-v2.js | |
Benchmark 1: bun run ../ReMonkey/src/Benchmark.res.mjs | |
Time (mean ± σ): 35.962 s ± 0.312 s [User: 36.652 s, System: 2.212 s] | |
Range (min … max): 35.464 s … 36.424 s 10 runs | |
Benchmark 2: node ../ReMonkey/src/Benchmark.res.mjs | |
Time (mean ± σ): 18.156 s ± 0.235 s [User: 18.160 s, System: 0.126 s] | |
Range (min … max): 17.720 s … 18.514 s 10 runs | |
Benchmark 3: deno run ../ReMonkey/src/Benchmark.res.mjs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ ruby plot.rb hyperfine-reports/JS-total-showdown.js | |
┌ ┐ | |
bun run ../ReMonkey/src/Benchmark.res.mjs ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 35.83784912246 | |
node ../ReMonkey/src/Benchmark.res.mjs ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 18.18417210286 | |
bun run ../TSMonkey/benchmark.js ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 16.30219026496 | |
node ../TSMonkey/benchmark.js ┤■■■■■■■■■■■■■■■■■■■■■■■■■■ 11.29732625396 | |
./benchmarks-bun.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 32.16708024236 | |
./benchmarks-node.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 32.03700059456 | |
└ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ hyperfine -w 3 'bun run ../ReMonkey/src/Benchmark.res.mjs' 'node ../ReMonkey/src/Benchmark.res.mjs' 'bun run ../TSMonkey/benchmark.js' 'node ../TSMonkey/benchmark.js' './benchmarks-bun.sh eval-fast' './benchmarks-node.sh eval-fast' --export-json ../hyperfine-reports/JS-total-showdown.js | |
Benchmark 1: bun run ../ReMonkey/src/Benchmark.res.mjs | |
Time (mean ± σ): 35.838 s ± 0.203 s [User: 36.609 s, System: 2.151 s] | |
Range (min … max): 35.598 s … 36.228 s 10 runs | |
Benchmark 2: node ../ReMonkey/src/Benchmark.res.mjs | |
Time (mean ± σ): 18.184 s ± 0.116 s [User: 18.195 s, System: 0.119 s] | |
Range (min … max): 17.932 s … 18.341 s 10 runs | |
Benchmark 3: bun run ../TSMonkey/benchmark.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec eval = (program: AST.program, env: environment) => { | |
let result: ref<option<mObject>> = ref(None) | |
let keep = ref(true) | |
program.statements->Array.forEach(statement => { | |
if keep.contents { | |
result := evaluateStatement(Some(statement), env) | |
result.contents->Option.forEach(contents => { | |
switch contents { | |
| MReturnValue({value}) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun eval(program: Program, env: Environment): MObject? { | |
var result: MObject? = null | |
for (statement in program.statements) { | |
result = eval(statement, env) | |
when (result) { | |
is MReturnValue -> return result.value | |
is MError -> return result | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ ruby --yjit plot.rb kotlin-wasm-eval-fast.json | |
┌ ┐ | |
./benchmarks-bun.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 34.566014226200004 | |
./benchmarks-jvm.sh eval-fast ┤■■■■■■■■ 3.6206429516 | |
./benchmarks-native.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 16.9771580748 | |
./benchmarks-node.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 32.925853603600004 | |
./benchmarks-wasm-wasi.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■ 11.295171940900001 | |
./benchmarks-wasm-js.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■ 11.3097880403 | |
└ ┘ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ ruby --yjit plot.rb kotlin-wasm-vm-fast.json | |
┌ ┐ | |
./benchmarks-bun.sh vm-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 22.704543833360002 | |
./benchmarks-jvm.sh vm-fast ┤■■■■■■■■■■■■■■■■■■ 5.12403986566 | |
./benchmarks-native.sh vm-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 10.128824652159999 | |
./benchmarks-node.sh vm-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 22.852397735060002 | |
./benchmarks-wasm-wasi.sh vm-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 15.80210154176 | |
./benchmarks-wasm-js.sh vm-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 17.04475952096 | |
└ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hyperfine -w 3 './exe/benchmark-linux-tr-yjit' | |
Benchmark 1: ./exe/benchmark-linux-tr-yjit | |
Time (mean ± σ): 150.3 ms ± 1.2 ms [User: 133.1 ms, System: 16.9 ms] | |
Range (min … max): 148.3 ms … 152.6 ms 19 runs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hyperfine -w 3 './fibonacci --engine=eval' | |
Benchmark 1: ./fibonacci --engine=eval | |
Time (mean ± σ): 10.546 s ± 0.042 s [User: 11.254 s, System: 0.353 s] | |
Range (min … max): 10.503 s … 10.650 s 10 runs |
NewerOlder