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.0Haskell GHC #3 9.059.063,208274  0% 0% 100% 0%
2.3Go 6g 8g #3 20.6120.613,272347  0% 100% 0% 0%
2.3Go 6g 8g 20.6220.623,284309  0% 0% 100% 0%
2.8GNU gcc #3 25.6525.6517,032607  0% 0% 100% 0%
3.1Smalltalk VisualWorks #2 28.0728.0723,924566  0% 0% 0% 100%
3.5Erlang HiPE 31.7831.7810,152273  0% 5% 95% 0%
3.5Java 6 -server #4 30.7531.98293,408894  32% 27% 17% 18%
11Scheme PLT 103.01103.0131,744262  0% 100% 0% 0%
13Pascal Free Pascal 121.31122.264,744523  23% 44% 9% 15%
14Scala 151.86128.21223,632339  29% 35% 28% 23%
16GNU gcc #2 142.29144.582,704575  24% 10% 24% 35%
16ATS 144.83146.834,7801090  8% 39% 13% 36%
19GNU gcc 167.65173.764,704487  33% 7% 0% 53%
20C++ GNU g++ #2 170.77177.195,352588  56% 6% 6% 27%
20OCaml #3 178.81180.825,296296  2% 16% 48% 30%
21OCaml #2 188.35187.857,300350  31% 16% 37% 7%
23C++ GNU g++ 249.64206.825,384636  28% 34% 30% 19%
24Lisp SBCL 217.68214.6568,216618  3% 31% 57% 6%
25Python CPython #2 225.39225.898,244287  47% 3% 12% 34%
29Lisp SBCL #2 285.63266.1368,388571  36% 16% 13% 37%
34Java 6 -server #3 5 min5 min364,220530  6% 2% 29% 59%
36Ada 2005 GNAT #2 6 min5 min9,840560  36% 30% 28% 20%
44Go 6g 8g #2 7 min6 min3,344333  23% 42% 7% 30%
44Ada 2005 GNAT 9 min6 min9,772602  40% 29% 35% 26%
49C# Mono 13 min7 min13,404476  46% 38% 35% 39%
50Java 6 -Xint #3 7 min7 min53,480530  16% 53% 0% 28%
56Ruby JRuby 8 min8 min92,992342  7% 44% 49% 1%
57Perl #3 9 min8 min842,364489  35% 20% 30% 16%
57Ruby JRuby #2 13 min8 min84,944228  22% 58% 36% 23%
71F# Mono 18 min10 min15,284472  30% 41% 46% 45%
80OCaml 12 min12 min8,488282  20% 33% 32% 12%
114Java 6 -Xint #4 16 min17 min96,884894  36% 33% 13% 10%
198Ruby MRI #2 29 min29 min14,580228  100% 0% 0% 0%
252Perl 48 min38 min280,424353  46% 40% 17% 10%
340Ruby MRI 51 min51 min14,168342  1% 100% 1% 1%
interesting alternative programs
0.2Java 6 -server #6 1.441.41266,276543
0.6Java 6 -server #2 5.105.1377,376693
1.6Lua #3 14.2314.231,644264
1.7Lua 15.1215.121,736255
1.7Python CPython #3 15.4515.464,008272
1.7Java 6 -server #5 15.2115.74165,620432
1.8Lua #2 16.0216.021,672284
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
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