How big is the measured performance difference?

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

 thread-ring benchmark N=50,000,000

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

Compare how much Memory the thread-ring programs used - sort Memory KB. Compare how much Code the programs used - sort Code B

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

    sort sort sort sort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ~ CPU Load
1.0GNU gcc #3 5.125.1216,760607  0% 0% 0% 100%
1.5Erlang HiPE 7.907.915,628273  0% 0% 99% 0%
1.7Haskell GHC #3 8.598.602,936274  0% 0% 0% 100%
3.1Mozart/Oz 15.8815.884,068340  0% 0% 0% 100%
4.1Go 6g 8g #3 21.0321.033,048347  0% 0% 0% 100%
4.1Go 6g 8g 21.1021.103,084309  0% 0% 0% 100%
4.9Java 6 -server #4 24.9424.96120,964894  0% 0% 0% 100%
7.1Smalltalk VisualWorks #2 36.1336.1313,084566  0% 0% 0% 100%
15Pascal Free Pascal 77.2877.282,560523  0% 0% 0% 100%
18Scheme PLT 91.1791.1719,672262  0% 0% 0% 100%
20ATS 100.77100.764,6041090  0% 0% 0% 100%
20GNU gcc 101.45101.454,540487  0% 0% 0% 100%
20GNU gcc #2 102.60102.592,532575  0% 0% 0% 100%
20C++ GNU g++ #2 102.73102.735,124588  0% 0% 0% 100%
23OCaml #2 116.42116.424,964350  0% 0% 0% 100%
23Scala 117.68117.6964,372339  0% 0% 0% 100%
24OCaml #3 122.46122.452,968296  0% 0% 0% 100%
30C++ GNU g++ 154.43154.423,124636  0% 0% 0% 100%
31Python CPython #2 156.21156.207,200287  0% 0% 0% 100%
31Python 3 #2 158.01158.008,356288  0% 0% 0% 100%
31Go 6g 8g #2 159.09159.083,156333  0% 0% 0% 100%
41Java 6 -server #3 208.83208.85118,032530  0% 0% 0% 100%
45Lisp SBCL #2 230.50230.4958,724571  0% 0% 0% 100%
51Ada 2005 GNAT #2 263.46263.458,928560  0% 0% 0% 100%
53Java 6 -Xint #3 269.64269.6429,368530  0% 0% 0% 100%
55C# Mono 282.61282.6011,396476  0% 0% 0% 100%
58Ada 2005 GNAT 298.11298.108,796602  0% 0% 0% 100%
71Ruby JRuby 6 min6 min96,696342  0% 0% 0% 100%
72F# Mono 6 min6 min13,148472  0% 0% 0% 100%
78OCaml 6 min6 min5,628282  0% 0% 0% 100%
88Perl #3 7 min7 min489,092489  0% 0% 0% 100%
92Ruby JRuby #2 7 min7 min97,136228  0% 0% 0% 100%
169Java 6 -Xint #4 14 min14 min42,104894  0% 0% 0% 100%
304Ruby MRI #2 25 min25 min10,252228  0% 0% 0% 100%
569Ruby MRI 48 min48 min8,396342  0% 0% 0% 100%
Lisaac Make Error810
Lisp SBCL Timed Out1h 00 min618
Perl Timed Out2h 00 min353
Ruby 1.9 #2 Failed228
Ruby 1.9 Failed342
interesting alternative programs
0.3Java 6 -server #6 1.251.37105,336543
0.7Lua LuaJIT #3 3.743.75904264
0.9Lua LuaJIT #2 4.524.52920284
1.0Java 6 -server #2 5.145.1747,428693
1.1Lua LuaJIT 5.815.82952255
2.5Java 6 -server #5 12.8712.91119,856432
3.1Lua #2 15.7915.791,296284
3.1Lua #3 16.0516.051,272264
3.3Lua 16.8216.821,328255
3.7Python CPython #3 18.9718.973,100272
3.9Python 3 #3 20.0920.104,172270
missing programs
Clean No program
Fortran Intel No program
Java 6 steady state No program
JavaScript TraceMonkey No program
JavaScript V8 No program
Lua No program
Lua LuaJIT No program
PHP No program

 thread-ring benchmark : Switch from thread to thread passing one token

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

Each program should create and keep alive 503 threads, explicity or implicitly linked in a ring, and pass a token between one thread and the next thread at least N times.

Each program should

Similar benchmarks are described in Performance Measurements of Threads in Java and Processes in Erlang, 1998; and A Benchmark Test for BCPL Style Coroutines, 2004. For some language implementations increasing the number of threads quickly results in Death by Concurrency.

Programs may use kernel threads, lightweight threads; but coroutines, cooperative threads and other programs with custom schedulers will be listed as interesting alternative implementations. Briefly say what concurrency technique is used in the program header comment.

Revised BSD license