thread-ring benchmark hypotheses non fingo

↓ Switch from thread to thread passing one token, N=10,000,000.

Which programs used least Code? Which programs use highly optimised assembly code libraries? Which programs make use of all the processor cores?

    sort sort sort sort
  ×   Program & Logs CPU secs Elapsed secs Memory KB Code B ~ CPU Load
1.0Haskell GHC #2 6.702,672260  
1.1Erlang HiPE 7.495,368273  
1.3Mozart/Oz 8.783,888340  
3.3Smalltalk Squeak 21.9537,016544  
5.0Smalltalk VisualWorks #2 33.2913,012566  
6.3SML MLton 41.876,132361  
8.3Intel 55.804,584487  
8.4Scala 56.4422,752339  
8.5GNU gcc 56.744,504487  
8.5Lisaac 56.858,596810  
8.6Pascal Free Pascal 57.532,588523  
8.8Scheme Chicken 59.082,612421  
9.1Digital Mars 61.018,700560  
12Smalltalk GNU 78.049,536551  
12OCaml #3 80.312,900296  
13OCaml #2 83.892,896350  
13Python Psyco #2 84.017,820300  
13Scheme PLT 90.1221,388262  
15C++ GNU g++ 101.282,960626  
15Python CPython #2 102.316,772287  
17Python CPython 114.286,756397  
20Nice #2 132.4823,600382  
20Java 6 -server #3 134.9823,336530  
20Java 6 -Xms64m #3 134.9927,628530  
21Java 6 -client #3 138.0922,456530  
22Ada 2005 GNAT 149.897,752602  
25C# Mono 168.8711,956476  
27Java 6 -Xint #3 183.3120,948530  
49Digital Mars #2 5 min2,792555  
52Java 6 -server 5 min25,364587  
54Groovy 5 min53,212489  
55OCaml 6 min3,616282  
77CAL 8 min27,072927  
88Ruby JRuby #2 9 min42,028228  
100Ruby JRuby 11 min44,256342  
282Ruby MRI #2 31 min16,740228  
623Ruby MRI 1h 09 min12,088342  
C++ Intel Failed626
Perl Timed Out353
Perl #2 Failed288
Python IronPython Failed397
Python IronPython #2 Failed287
Ruby 1.9 Failed342
Ruby 1.9 #2 Failed228
Tcl Failed445
Zonnon Mono Failed489
Zonnon Mono #2 Failed396
interesting alternative programs
 Lua LuaJIT #2 Failed  248
 Lua #2 Failed  248
 Python IronPython #3 Failed  272
0.2Java 6 -server #2 1.210.0011,900693
1.6Python CPython #3 10.680.002,624272
2.7Lua 17.950.001,280255
3.0Lua LuaJIT 19.870.003,732255
missing programs
BASIC FreeBASIC No program
CINT No program
Clean No program
Eiffel SmartEiffel No program
F# Mono No program
Forth bigForth No program
Forth GNU GForth No program
Fortran G95 No program
Fortran Intel No program
Icon No program
Io No program
Java 1.4 -server No program
Java GNU gcj No program
JavaScript Rhino No program
JavaScript SpiderMonkey No program
Lisp SBCL No program
Lua No program
Lua LuaJIT No program
Mercury No program
Oberon-2 OO2C No program
PHP No program
Pike No program
Prolog SWI No program
Prolog YAP No program
Rebol No program
Scheme Ikarus No program
SML SML/NJ 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