[dundee] old posts on Erlang vs Stackless python

Rick Moynihan rick.moynihan at gmail.com
Sun Apr 20 21:06:02 BST 2008


Hey Kris,

Sorry for the delayed reply; just back from my holiday.

2008/4/11 azmodie <azmodie at gmail.com>:
> just surfing about came across some intresting links.
> these links are inspired by an exercise set after chapter 8 of Joe
> Armstrong's Erlang book
>
> comparison with stackless python
> http://muharem.wordpress.com/2007/07/31/erlang-vs-stackless-python-a-first-benchmark/
>  (NOTE: after reading comments, this is not a brilliant comparison. but
> raises some good points)

Yes, I saw this benchmark sometime ago; but it doesn't really say
anything meaningfull.  Indeed the circular message passing benchmark
suggested by Joe is a poor benchmarking choice as the algorithm is
inherently serial.  i.e. there is no scope for parallelism across
cores or machines because a process can only "pass the parcel" when it
has it.

A far better benchmark for comparing the performance of
parallelization is this one:

http://www.franklinmint.fm/blog/archives/000792.html

Here each process sends a message to every other process.  As you can
see from the results each time you double the number of CPU's
(schedulers) you almost half the time of the benchmark.  This is
exactly the sort of performance increase erlang promises (obviously
not all algorithms scale nearly as well as this benchmark).

I don't know much about Python or Stackless, but my understanding is
that this kind of performance won't be possible until they remove the
Global Interpreter Lock (GIL) which ensures only a single thread is
running in the interpreter at once.  This effectively means Python and
Stackless developers won't be able to efficiently exploit multi-core
anytime soon.  I'd expect Stackless to  perform incredibly poorly on
the above benchmark.

> comparison with termite
> http://jaortega.wordpress.com/2007/05/14/erlang-termite-and-a-blog/
>
> so Rick as your are playing with erling what is your take on these ?
> have you tried this exercise yourself ?.

Yes, Termite and Gambit Scheme are pretty damn cool.  My biggest
problem with Erlang is that it's REPL (interactive interpreter) is
quite limited, whilst Erlang macro's are more like the C-preprocessor
and aren't a patch on those in Lisp and Scheme.  Implementing an
Erlang like Scheme would probably be the best of both worlds.

I've briefly looked at Termite before and it seemed to  primarily be
an academic experiment rather than a production language.  Contrast
this to Erlang which has 20 years of heavy commercial use and my
pragmatic heuristics win out.   But I'm still itching to have a play
with it.

As for the benchmarks... No I've not run any, other than to measure
the cost of process spawning.  Generally I don't tend to put too much
weight on micro-benchmarks as they lead to apples-and-oranges
comparisons.  This said they often generate good discussion about why
you're comparing apples and oranges :-)

R.



More information about the dundee mailing list