Each chart bar shows how many times slower, one ↓ binary-trees program was, compared to the fastest program.
These are not the only programs that could be written. These are not the only compilers and interpreters. These are not the only programming languages.
Column × shows how many times more each program used compared to the benchmark program that used least.
|×||Program Source Code||CPU secs||Elapsed secs||Memory KB||Code B||≈ CPU Load|
|1.0||Nuitka #7||2.30||0.69||16,612||741||78% 83% 93% 82%|
|1.1||Nuitka||2.44||0.75||16,676||706||81% 77% 93% 81%|
|1.1||Pyston||2.03||0.76||36,896||743||63% 65% 84% 62%|
|1.2||PyPy 2||1.74||0.82||89,292||743||47% 75% 48% 46%|
|1.2||Nuitka #6||2.78||0.83||17,388||743||84% 80% 92% 83%|
|1.3||Python development version #7||2.96||0.89||15,880||741||85% 84% 80% 89%|
|1.3||Python 3 #7||2.98||0.90||15,752||741||91% 83% 82% 82%|
|1.4||Python 3||3.20||0.96||15,760||706||83% 83% 84% 89%|
|1.4||Python development version||3.16||0.97||15,616||706||85% 75% 89% 82%|
|1.5||PyPy 3 #7||1.95||1.02||137,688||741||78% 36% 40% 41%|
|1.5||Python 2||3.75||1.04||16,568||743||91% 90% 90% 96%|
|1.5||Python development version #6||3.55||1.05||16,748||743||90% 85% 86% 83%|
|1.5||Python 3 #6||3.60||1.06||16,576||743||92% 86% 86% 83%|
|1.6||PyPy 3 #6||2.28||1.12||89,220||743||46% 39% 41% 85%|
|1.7||PyPy 3||2.26||1.18||89,808||706||41% 79% 36% 40%|
|1.7||Numba||3.87||1.19||22,116||702||95% 79% 76% 81%|
|missing benchmark programs|
diff program output N = 10 with this 1KB output file to check your program is correct before contributing.
We are trying to show the performance of various programming language implementations - so we ask that contributed programs not only give the correct result, but also use the same algorithm to calculate that result.
Each program should
Note: this is an adaptation of a benchmark for testing GC so we are interested in the whole tree being allocated before any nodes are GC'd - which probably excludes lazy evaluation.
Note: the left subtrees are heads of the right subtrees, keeping a depth counter in the accessors to avoid duplication is cheating!
Note: the tree should have tree-nodes all the way down, replacing the bottom nodes by some other value is not acceptable; and the bottom nodes should be at depth 0.
Note: these programs are being measured with the default initial heap size - the measurements may be very different with a larger initial heap size or GC tuning.
Please don't implement your own custom memory pool or free list.
The binary-trees benchmark is a simplistic adaptation of Hans Boehm's GCBench, which in turn was adapted from a benchmark by John Ellis and Pete Kovac.
Thanks to Christophe Troestler and Einar Karttunen for help with this benchmark.