[erlang-questions] On a positive Erlang performance note...

Mikael Pettersson <>
Fri Nov 21 13:59:34 CET 2008


Edwin Fine writes:
 > I've previously expressed some disappointment in Erlang's worst-case
 > scenario SMP performance (lots of messages, very little done with each
 > message, communicating parallel SMP processes).
 > 
 > Now, to balance that out, I want to praise Erlang (and HiPE) for a virtually
 > linear SMP speedup in a character classification test I ran.
 > 
 > Using sequential and parallelized code (rpc:pmap) and a HiPE-compiled module
 > on an Intel Q6600/Ubuntu/8GB/R12B-4, which classified every byte of a 40MB
 > file into character classes (e.g. punct, blank), the following results were
 > achieved:
 > 
 > Sequential: 18817812 bytes/second
 > Parallelized: 74937454 bytes/second
 > Speedup: 3.98 (on a 4-core system).
 > 
 > That's extremely close to linear and is pretty impressive. I found HiPE gave
 > about a 10x speedup over BEAM. The results are with HiPE and exclude the
 > time taken to load the file into a binary.
 > 
 > Kudos to Erlang and HiPE.

Thanks.

 > I had to do a bit of ugly code to get this level of performance, though
 > (using dicts and arrays to keep the counts was just too slow - I fell to
 > using a separate parameter for each of the 12 counts).
 > 
 > The outputs follow (ascsp is something I added - counts ASCII SP (32) chars,
 > and the purpose of '8bit' is self-evident). The other character classes are
 > defined as per http://en.wikipedia.org/wiki/Regular_expression .
 > 
 > Regards,
 > Ed
 > 
 > PS In the unlikely event that someone wants the code, I will gladly post it
 > if asked.

Please do. I'd like to include it in the benchmark section
of HiPE's compiler test suite.
The 10x speedup over BEAM really put a smile on my face :-)

/Mikael



More information about the erlang-questions mailing list