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.135.1316,760607  0% 100% 0% 0%
1.6Haskell GHC #3 8.478.472,932274  0% 0% 0% 100%
3.1Mozart/Oz 15.9115.914,356340  0% 0% 0% 100%
4.1Go 6g 8g #3 21.0421.043,048347  0% 0% 0% 100%
4.1Go 6g 8g 21.0921.093,084309  0% 0% 100% 0%
6.1Java 6 -server #4 30.6131.53119,832894  32% 29% 19% 16%
6.9Erlang HiPE 35.5735.586,452273  0% 2% 0% 98%
7.0Smalltalk VisualWorks #2 35.8735.8613,088566  0% 0% 100% 0%
18Scheme PLT 91.1491.1419,648262  0% 100% 0% 0%
27Pascal Free Pascal 124.66139.582,556523  43% 33% 3% 4%
31GNU gcc #2 158.43158.852,532575  9% 10% 30% 48%
34GNU gcc 164.71172.164,536487  36% 2% 10% 46%
34C++ GNU g++ #2 163.36174.215,120588  5% 55% 33% 0%
34ATS 166.90175.724,6001090  5% 29% 59% 0%
36OCaml #3 185.42186.102,968296  20% 35% 15% 27%
37OCaml #2 188.29189.074,964350  34% 27% 23% 7%
43C++ GNU g++ 257.79218.233,124636  31% 30% 18% 30%
43Scala 6 min218.78155,780339  48% 48% 42% 40%
48Python CPython #2 240.25246.427,204287  3% 49% 42% 2%
49Python 3 #2 247.36250.068,364288  50% 9% 3% 33%
55Lisp SBCL 295.73283.8358,444618  30% 19% 13% 38%
59Java 6 -server #3 5 min5 min118,132530  1% 36% 47% 13%
66Lisp SBCL #2 6 min5 min58,176571  27% 27% 21% 27%
71Ada 2005 GNAT #2 7 min6 min8,928560  32% 28% 31% 26%
71Java 6 -Xint #3 6 min6 min29,380530  6% 22% 54% 14%
81Go 6g 8g #2 7 min6 min3,116333  21% 43% 7% 32%
84Ada 2005 GNAT 10 min7 min8,792602  39% 34% 23% 32%
94C# Mono 13 min8 min11,400476  39% 33% 46% 39%
98Ruby JRuby #2 12 min8 min91,128228  50% 16% 25% 50%
100Ruby JRuby 8 min8 min96,344342  40% 7% 5% 47%
103Perl #3 8 min8 min488,940489  37% 17% 7% 36%
131F# Mono 18 min11 min13,108472  33% 38% 42% 40%
133OCaml 11 min11 min5,656282  40% 33% 6% 15%
196Java 6 -Xint #4 16 min16 min42,128894  26% 33% 21% 14%
300Ruby MRI #2 25 min25 min10,332228  0% 0% 100% 0%
570Ruby MRI 48 min48 min8,396342  0% 0% 0% 100%
Lisaac Make Error810
Perl Timed Out2h 00 min353
Ruby 1.9 #2 Failed228
Ruby 1.9 Failed342
interesting alternative programs
0.2Java 6 -server #6 1.271.27105,164543
0.7Lua LuaJIT #3 3.763.76900264
0.9Lua LuaJIT #2 4.534.53924284
1.0Java 6 -server #2 5.085.09102,376693
1.1Lua LuaJIT 5.835.83956255
3.1Lua #2 15.7515.761,292284
3.2Lua #3 16.2516.251,272264
3.2Java 6 -server #5 16.0716.4598,708432
3.3Lua 17.1817.191,328255
3.7Python CPython #3 19.0219.023,100272
3.9Python 3 #3 20.1320.134,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