This file contains 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
function evaluateNode(node, env) { | |
if (node instanceof Identifier) { | |
const value = env.get(node.value); | |
if (value === null) { | |
const builtin = builtins.get(node.value); | |
if (builtin !== undefined) { | |
return builtin; | |
} | |
return new MError(`identifier not found: ${node.value}`); | |
} |
This file contains 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
function eval_1($this, expression, env) { | |
var tmp0_subject = expression; | |
var tmp; | |
if (tmp0_subject instanceof Identifier) { | |
var value = env.te(expression.za_1); | |
var tmp_0; | |
if (value == null) { | |
var builtin = get_builtins().a2(expression.za_1); | |
tmp_0 = builtin == null ? new MError('identifier not found: ' + expression.za_1) : builtin; | |
} else { |
This file contains 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 kt-vs-ts.json | |
┌ ┐ | |
./benchmarks-bun.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 47.04533121558 | |
bun run ../TSMonkey/benchmark.ts ┤■■■■■■■■■■■■■■■■■■■■■■■■■■ 14.464090869880001 | |
└ ┘ |
This file contains 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 './benchmarks-bun.sh eval-fast' 'bun run ../TSMonkey/benchmark.ts' --export-json kt-vs-ts.json | |
Benchmark 1: ./benchmarks-bun.sh eval-fast | |
Time (mean ± σ): 47.045 s ± 0.788 s [User: 32.528 s, System: 16.987 s] | |
Range (min … max): 45.921 s … 48.228 s 10 runs | |
Benchmark 2: bun run ../TSMonkey/benchmark.ts | |
Time (mean ± σ): 14.464 s ± 0.180 s [User: 8.788 s, System: 6.610 s] | |
Range (min … max): 14.229 s … 14.741 s 10 runs | |
Summary |
This file contains 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 js-vm-all.json | |
┌ ┐ | |
./benchmarks-bun.sh vm-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 26.54168190048 | |
./benchmarks-node.sh vm-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 29.858029703380005 | |
└ ┘ |
This file contains 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 js-eval-all.json | |
┌ ┐ | |
./benchmarks-bun.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 46.647437907100006 | |
./benchmarks-node.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 52.0971284792 | |
└ ┘ |
This file contains 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
Runtime | Mem | |
---|---|---|
GraalVM | 55.43359375 MB | |
JVM | 419.2890625 MB | |
Native | 3.85546875 MB |
This file contains 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 vm-all.json | |
┌ ┐ | |
./benchmarks-jvm.sh vm-fast ┤■■■■■■■■■■■■■■■■■ 4.05584675816 | |
./benchmarks-graal.sh vm-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 10.54270851846 | |
./benchmarks-native.sh vm-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 19.83852377616 | |
└ ┘ |
This file contains 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 eval-all.json | |
┌ ┐ | |
./benchmarks-jvm.sh eval-fast ┤■■■■■■■■■■■■ 4.467866928019999 | |
./benchmarks-graal.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■ 9.253937852019998 | |
./benchmarks-native.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 32.51221281742 | |
└ ┘ |
This file contains 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 './benchmarks-jvm.sh vm-fast' './benchmarks-graal.sh vm-fast' './benchmarks-native.sh vm-fast' --export-json vm-all.json | |
Benchmark 1: ./benchmarks-jvm.sh vm-fast | |
Time (mean ± σ): 4.056 s ± 0.063 s [User: 3.679 s, System: 0.720 s] | |
Range (min … max): 3.966 s … 4.165 s 10 runs | |
Benchmark 2: ./benchmarks-graal.sh vm-fast | |
Time (mean ± σ): 10.543 s ± 0.154 s [User: 10.401 s, System: 0.134 s] | |
Range (min … max): 10.290 s … 10.699 s 10 runs | |
Benchmark 3: ./benchmarks-native.sh vm-fast |