Benchmark results from :
http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&lang=all#about
--------------------------------------------------------------------------------
the thread-ring (new) benchmark rules
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
* create 503 linked threads (named 1 to 503)
* thread 503 should be linked to thread 1, forming an unbroken ring
* pass a token to thread 1
* pass the token from thread to thread N times
* print the name of the last thread (1 to 503) to take the token
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… 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.
Results of this benchmark:
weigth
Free Pascal c gcc java cpuspeed memory
2.97 3.90 13.78 1 1
5.11 5.84 16.57 3 1
6.13 6.68 17.85 5 1
3.89 4.77 15.19 5 3
2.97 3.90 13.78 5 5
the lower the number, the better the score.
--------------------------------------------------------------------------------
The sum-file benchmark measures line-oriented I/O and string conversion.
Each program should:
* read integers from stdin, one line at a time
* print the sum of those integers
Programs should use built-in line-oriented I/O functions rather than
custom-code. No line will exceed 128 characters, including newline.
Reading one line at a time, the programs should run in constant space.
Resukts of this benchmark:
x Program & Logs CPU Time secs Memory Use KB GZip Bytes
1.5 Java 6 -server 4.16 10,836 206
1.9 C gcc 5.24 324 180
2.0 C gcc 5.54 320 159
2.0 Free Pascal 5.60 96 128
You can see that java is the fastest but uses a lot of memory.
-------------------------------------------------------------------------
Mandlebrot output N=200,converted to PNG
Each program should plot the Mandelbrot set [-1.5-i,0.5+i] on an N-by-N
bitmap. Write output byte-by-byte in portable bitmap format.
For more information see Eric W. Weisstein, "Mandelbrot Set." From
MathWorld--A Wolfram Web Resource.
http://mathworld.wolfram.com/MandelbrotSet.html
x Program & Logs CPU Time secs Memory Use KB GZip Bytes
1.0 C++ g++ 3.00 884 1081
1.0 C gcc 3.12 380 632
1.1 SmartEiffel 3.29 404 515
1.1 Java 6 -server 3.29 10,124 607
2.1 Free Pascal 6.22 96 437
You can see that java is the fastest but uses a lot of memory.
Conclusion : It would be good to have a compiler switch that optimizes
for speed.
regards
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives