The Great Computer Language Shootout is back

Isaac Gouy <>
Tue Jul 27 17:42:23 CEST 2004


Last month there were a few postings about the Erlang code in "The
Great Computer Language Shootout"
http://shootout.alioth.debian.org/lang/erlang/

> Bengt Kleberg wrote:
> i have sent a wc.erl (see below)

My guess is that this solution exceeds the max time allowed by the
Shootout test program. 

Using the same approach for sumcol takes ~51s on my machine with
Standalone Erlang (probably over the max time on the Shootout test
machine). How do we do this faster?

-module(sumcol).
-export([start/1]).

start(Args) ->
   loop(io:fread('',"~d"), 0).

loop(eof, Sum) ->
   io:format("~w~n", [Sum]);
loop({ok,[N]}, Sum) ->
   loop(io:fread('',"~d"), Sum+N).


> Marc van Woerkom wrote:
> Shoutout benchmark did not use native compilation

So let us know how to use native compilation! 
Use the Shootout mailing list, or email Brent.


> Vance Shipley wrote:
> It had been using the process dictionary and was doing throws.
> I rewrote it to handle real exceptions and not use the process
> dictionary.  I managed to slow it down. :)

What's wrong with doing throws? (I copied from the old Erlang book.)
I was tempted to use the process dictionary for the hash tests too ;-) 

best wishes, Isaac


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the erlang-questions mailing list