Erlang/OTP Forums

Author Message

<  Erlang  ~  Erlang VM performance

dotNox
Posted: Wed Sep 23, 2009 10:54 pm Reply with quote
Joined: 23 Sep 2009 Posts: 1
Hello,

I was playing with http://shootout.alioth.debian.org/u32q/benchmark.php?test=chameneosredux&lang=hipe&id=1
Running it in erlang with SMP support and without
With SMP support:
Code:
#> erlc +native +"{hipe, [o3]}" test.erl
#> rm test.erl
#> time erl -smp enable -noshell -run  test main 6000000
blue + blue -> blue
blue + red -> yellow
blue + yellow -> red
red + blue -> yellow
red + red -> red
red + yellow -> blue
yellow + blue -> red
yellow + red -> blue
yellow + yellow -> yellow

 blue red yellow
4002076 zero
4032679 zero
3965245 zero
 one two zero zero zero zero zero zero

 blue red yellow red yellow blue red yellow red blue
1187358 zero
1230735 zero
1175737 zero
1214289 zero
1185395 zero
1198335 zero
1220287 zero
1206158 zero
1204679 zero
1177027 zero
 one two zero zero zero zero zero zero


real   1m54.189s
user   2m10.872s
sys   0m10.229s



Without SMP support:
Code:
#> erlc +native +"{hipe, [o3]}" test.erl
#> rm test.erl
#> time erl -noshell -run  test main 6000000
blue + blue -> blue
blue + red -> yellow
blue + yellow -> red
red + blue -> yellow
red + red -> red
red + yellow -> blue
yellow + blue -> red
yellow + red -> blue
yellow + yellow -> yellow

 blue red yellow
4000000 zero
4000000 zero
4000000 zero
 one two zero zero zero zero zero zero

 blue red yellow red yellow blue red yellow red blue
1200000 zero
1200000 zero
1200000 zero
1200000 zero
1200000 zero
1200000 zero
1200000 zero
1200000 zero
1200000 zero
1200000 zero
 one two zero zero zero zero zero zero


real   0m24.769s
user   0m24.078s
sys   0m0.056s


Erlang R13B01 (erts-5.7.2) [source] [rq:1] [async-threads:0] [hipe] [kernel-poll:false]
Intel(R) Core(TM)2 Duo CPU T5450 @ 1.66GHz

is there any reason of such big difference in execution time ?

Thank you.
View user's profile Send private message
uwiger
Posted: Thu Sep 24, 2009 6:20 am Reply with quote
User Joined: 03 Jul 2006 Posts: 604 Location: Sweden
dotNox wrote:
Hello,

I was playing with http://shootout.alioth.debian.org/u32q/benchmark.php?test=chameneosredux&lang=hipe&id=1
Running it in erlang with SMP support and without
With SMP support:
Code:
...
real   1m54.189s
user   2m10.872s
sys   0m10.229s



Without SMP support:
Code:
 ...
real   0m24.769s
user   0m24.078s
sys   0m0.056s


is there any reason of such big difference in execution time ?


The Chameneos_redux benchmark is really a kind of 'rendezvous' benchmark where all processes periodically synchronize with all other processes. This means that there often isn't enough work to keep the schedulers busy.

I'm not sure what the R13B status is in this regard, but it used to be that the scheduler threads would go to sleep and have to be re-activated with a system call. Some experiments were made with having the schedulers busy-loop for a while if the run queue was empty, which improved things, but I think the fact remains that this benchmark is a poor match for message-passing concurrency. Practically all better entries resort to tricks with shared memory, spin loops, explicit yields, etc. (the very best entry, in C, uses kernel threads and compare-and-swap primitives), making this mainly a test of very low-level concurrency support.
View user's profile Send private message Visit poster's website

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum