Skip to content

Instantly share code, notes, and snippets.

View python311-vs-mypyc-plot
ruby plot.rb bruno_mypyc/python-vs-mypyc.json
┌ ┐
python benchmarks.py ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 664.1810843991666
python -c "import mypyc_exe" ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 594.9315874124999
└ ┘
View python311-vs-mypyc
hyperfine -w 1 -M 3 'python benchmarks.py' 'python -c "import mypyc_exe"' --export-json python-vs-mypyc.json
Benchmark 1: python benchmarks.py
Time (mean ± σ): 664.181 s ± 5.140 s [User: 504.246 s, System: 159.861 s]
Range (min … max): 661.213 s … 670.116 s 3 runs
Benchmark 2: python -c "import mypyc_exe"
Time (mean ± σ): 594.932 s ± 1.999 s [User: 488.391 s, System: 106.480 s]
Range (min … max): 592.685 s … 596.513 s 3 runs
Summary
View python311-vs-python310+pyston-plot
ruby plot.rb bruno/python-vs-pyston.json
┌ ┐
~/anaconda3/envs/bruno311/bin/python benchmarks.py ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 666.32469503344
(with pyston) python benchmarks.py ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 563.52862879444
└ ┘
View python311-vs-python310+pyston
hyperfine -w 1 -M 3 '~/anaconda3/envs/bruno311/bin/python benchmarks.py' 'python benchmarks.py' --export-json python-vs-pyston.json
Benchmark 1: ~/anaconda3/envs/bruno311/bin/python benchmarks.py
Time (mean ± σ): 666.325 s ± 13.175 s [User: 505.021 s, System: 161.279 s]
Range (min … max): 654.345 s … 680.435 s 3 runs
Benchmark 2: python benchmarks.py
Time (mean ± σ): 563.529 s ± 3.144 s [User: 563.484 s, System: 0.010 s]
Range (min … max): 561.231 s … 567.112 s 3 runs
Summary
View python311-vs-pypy3-plot
ruby plot.rb bruno/python311-vs-pypy.json
┌ ┐
python benchmarks.py ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 658.5324005012934
pypy3 benchmarks.py ┤■■■ 34.42451802762667
└ ┘
View python311-vs-pypy3
hyperfine -w 1 -M 3 'python benchmarks.py' 'pypy3 benchmarks.py' --export-json python311-vs-pypy.json
Benchmark 1: python benchmarks.py
Time (mean ± σ): 658.532 s ± 13.779 s [User: 502.028 s, System: 156.460 s]
Range (min … max): 647.729 s … 674.050 s 3 runs
Benchmark 2: pypy3 benchmarks.py
Time (mean ± σ): 34.425 s ± 16.328 s [User: 34.398 s, System: 0.022 s]
Range (min … max): 16.486 s … 48.422 s 3 runs
Summary
View kt-vs-ts-2-plot
ruby plot.rb kt-vs-ts-2.json
┌ ┐
./benchmarks-bun.sh eval-fast ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 45.654893785700004
bun run ../TSMonkey/benchmark.ts ┤■■■■■■■■■■■■■■■■■■■■■■■■■ 14.2863492943
└ ┘
View kt-vs-ts-2
hyperfine -w 3 './benchmarks-bun.sh eval-fast' 'bun run ../TSMonkey/benchmark.ts' --export-json kt-vs-ts-2.json
Benchmark 1: ./benchmarks-bun.sh eval-fast
Time (mean ± σ): 45.655 s ± 0.852 s [User: 30.591 s, System: 17.617 s]
Range (min … max): 44.481 s … 47.048 s 10 runs
Benchmark 2: bun run ../TSMonkey/benchmark.ts
Time (mean ± σ): 14.286 s ± 0.178 s [User: 8.775 s, System: 6.347 s]
Range (min … max): 14.039 s … 14.591 s 10 runs
Summary
View eval-ts-js.js
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}`);
}
View eval-kt-js.js
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 {