How big is the measured performance difference?

Each chart bar shows how many times more Time or how many times more Memory one unidentified ↓ binary-trees program used, compared to the benchmark program that used least Time or the program that used least Memory.

 binary-trees benchmark N=20

This table shows 5 measurements - CPU Time, Elapsed Time, Memory, Code and ≈ CPU Load.

Compare how much Memory the binary-trees programs used - sort Memory KB. Compare how much Code the benchmark programs used - sort Code B

Column × shows how many times more each program used compared to the benchmark program that used least.

    sort sort sort sort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0GNU gcc #7 13.887.06151,180850  53% 83% 2% 50%
1.3GNU gcc #2 30.449.28115,4921641  53% 99% 96% 81%
1.4C++ GNU g++ #6 28.5610.20382,904892  89% 68% 65% 58%
2.1Java 6 steady state #2 17.0414.90949,204675  93% 8% 7% 6%
2.2ATS 15.3415.34198,236926  0% 0% 100% 0%
2.4Java 6 -server #2 19.3717.20565,628603  7% 11% 81% 13%
2.5Scala #4 19.3017.57580,216536  6% 11% 80% 12%
2.8GNU gcc #5 68.5519.41424,544963  74% 91% 94% 96%
3.6OCaml #2 85.4825.54157,648784  75% 93% 70% 95%
4.4Haskell GHC 43.2430.90357,576512  5% 89% 42% 3%
4.7GNU gcc 33.2733.27131,644706  0% 0% 0% 100%
4.9C++ GNU g++ #2 34.6134.61197,836553  0% 0% 0% 100%
5.3Ada 2005 GNAT 37.1137.12198,136955  0% 0% 0% 100%
6.4Pascal Free Pascal 44.8644.87131,420769  0% 0% 0% 100%
8.5C# Mono #2 91.9259.70462,924650  44% 32% 43% 32%
11Scheme PLT #2 77.4877.48304,156503  0% 100% 0% 0%
17F# Mono 187.32118.42271,820587  35% 48% 41% 32%
18Java 6 -Xint #2 130.11126.31545,732603  3% 2% 95% 5%
35Go 6g 8g 245.46245.46301,264516  0% 0% 100% 0%
Haskell GHC #2 Make Error544
"interesting alternative" programs
 Haskell GHC #3 Make Error  544
3.3Go 6g 8g #2 22.9822.97222,404695

 binary-trees benchmark : Allocate and deallocate many many binary trees

diff program output N = 10 with this 1KB output file to check your program is correct before contributing.

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.

Revised BSD license

  Home   Flawed   Fastest   License   Help