[erlang-questions] This seems an unfair benchmark

G Bulmer gbulmer@REDACTED
Thu Sep 6 19:20:38 CEST 2007

On 6 Sep 2007, at 16:46, David King wrote:
> Subject: Re: [erlang-questions] This seems an unfair benchmark

>> http://weblog.plexobject.com/?p=1576
>> I was surfing reddit.com this morning and found this benchmark. The
>> problem with it is Erlang is the only one actually using
>> concurrency in
>> it, and I suspect his Erlang wasn't written very well. He was
>> comparing
>> Erlang using threads to Java/C++/Ruby only using method invocations.
>> Seems a bit biased eh?
>  From the article:
> "As far as mapping algorithm to the language, I found that Erlang fit
> very nicely for distributed algorithms that involve a lot of
> communications. I left the C++, Java and Ruby version very simple and
> didn?t try to implement truly indpendent processes and communication
> because that would have required a lot more effort".

Oh, don't ya just lurv this stuff !-)
I notice comments are disabled! I wonder why :-)

Summary. Here's some code in Java, C++, Ruby and Erlang.
Only Erlang implements the distributed Byzantine Generals Problem  
algorithm, because the other languages required too much effort.
I am not going to stop and conclude anything from this simple fact,  
and I am not going to explain why, or how I can continue.

The Java and Erlang programs break, so lets ignore that. The Ruby  
program looked broken so I killed it off.

I'll compare these programs, which don't actually implement the  
algorithm, with this Erlang program that does work mostly, and  
conclude that one of the programs that doesn't actually work, and  
which crashes, is the performance leader over the one program that  
does work!

I remember a story in the original "The Psychology of Computer  
Programming" by Gerald Weinberg (I read it around 1980, so sorry for  
Weinberg was asked to help a project which had failed badly to  
deliver. He came up with a solution, but the projects technical lead  
complained that Weinbergs working solution was much slower than his  
broken solution. Weinberg, approximately, said "if the requirement to  
give the correct answer was removed from my solution, it could go  
many, many times faster".

Ho, hum, how times have changed :-)

I clicked on the 'chart' and threw away the weird Erlang value, and  
the graph looks much more interesting.

Has anyone got a proper implementation of the distributed Byzantine  
Generals Problem algorithm in Erlang?


More information about the erlang-questions mailing list