Re:Concurrency's shysters
by kscaldef on Monday July 26, 2010 @12:08PM
(#1548363)
Erlang SMP is successful on one axis (ease of writing correct and reliable concurrent problems), but it seems to me that the argument in the article was about the performance costs of the model. And, at least as of a year or two ago, Erlang SMP did _not_ have good performance. There was a minimum factor of 2 overhead in total CPU usage just by turning on SMP, and heavily concurrent programs could run massively slower (http://shootout.alioth.debian.org/u64q/benchmark.php?test=ch...). At least part of the problem is that there's no affinity between Erlang processes and scheduler threads (and, therefore, CPU/cores), so you've got constant cache misses. There's probably other issues as well. As the author says, it's a hard problem.
[ Parent
| on HN ]
> There was a minimum factor of 2 overhead in total CPU usage just by turning on SMP
n-body without SMP 123.30s
n-body without SMP 123.30s elapsed
n-body with SMP 133.52s
n-body with SMP 133.57s elapsed
spectral-norm without SMP 46.68s
spectral-norm without SMP 46.68s elapsed
spectral-norm with SMP 47.71s
spectral-norm with SMP 13.90s elapsed
mandelbrot without SMP 230.07s
mandelbrot without SMP 230.10s elapsed
mandelbrot with SMP 253.66s
mandelbrot with SMP 87.76s elapsed
Maybe that Erlang chameneos-redux program is unusual?
"at least as of a year or two ago". So, maybe, as other people have pointed out and as I've already acknowledged, the situation may have improved.
stackoverflow shows recent BEAM and secret incantation (I haven't tried this yet, maybe tonite)
http://stackoverflow.com/questions/1996524/optimizing-perfor...
There was definitely a lot of discussion of these issues going on the last time I was playing around with Erlang, so it's quite possible progress has been made. My recommendation is to take my comments with a grain of salt, and comments on stackoverflow, and micro-benchmarks; and do your own testing and tweaking for your workload.
"About Erlang/OTP and Multi-core performance in particular"
http://www.erlang-factory.com/conference/London2009/speakers...