[erlang-questions] Erlang is the best choice for building commercial application servers
Jan Burse
janburse@REDACTED
Thu Mar 15 09:53:07 CET 2012
Tim Watson schrieb:
> http://shootout.alioth.debian.org/u64q/benchmark.php?test=pidigits&lang=all
Seems that shootout is a benchmark and a programming
contest at the same time. The Erlang PI solution, which
ranks after the Java solution, uses only one process
for the computation (plus one for IO), whereas the
Java solution uses 3 threads for the computation.
That many of the Java solutions are multi-threaded
is seen by the ratio of CPU secs and Elapsed sec.
But interestingly the average ratio for Erlang is also
high. I guess the ratio is rather an effect of the
programmed solution design, than of the compiler backend or
language runtime system. For example the Erlang
fannkuch-redux spawns 12 processes.
Here are the ratios and the total times:
Java 7 -server Erlang HiPE
CPU Elapsed Ratio CPU Elapsed Ratio
k-nucleotide 28.41 7.80 3.6 384.87 138.94 2.8
mandelbrot 27.49 7.01 3.9 266.21 75.90 3.5
reverse-complement 2.67 1.27 2.1 20.36 10.32 2.0
fannkuch-redux 68.93 17.45 4.0 503.82 126.59 4.0
fasta 5.26 5.18 1.0 31.07 31.07 1.0
n-body 22.51 22.49 1.0 129.44 129.48 1.0
pidigits 8.57 3.86 2.2 16.28 15.13 1.1
binary-trees 18.02 8.66 2.1 72.11 28.15 2.6
regex-dna 36.57 12.35 3.0 150.17 40.10 3.7
spectral-norm 17.57 4.51 3.9 47.65 12.12 3.9
Total 236.00 90.58 2.6 1621.98 607.80 2.7
(Source:
http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=java&lang2=hipe)
But when the programming is similar, i.e. high ratio, one
might guess that the tests then boil down to a comparison
of the compiler backend and the language runtime system.
The total elapsed time 607.80 secs Erlang vs 90.58 secs Java reminds
me of the naive reverse bachmark I did, i.e. 60ms vs 15ms (turbo).
But its a little worse, and I didn't use Erlang HIPE. The figures
for Erlang are much worse.
So micro benchmarks can give you a first impression of what one
has to expect from non-micro benchmarks. Kind of love at first
sight, and then get disappointed? But the above benchmarks
would sure turn my consumer box into a frying pan (ventilator
kicking in), with all this parallelism.
Bye
More information about the erlang-questions
mailing list