The Computer Language Shootout
Ulf Wiger (AL/EAB)
Fri Mar 17 10:57:41 CET 2006
One obvious first optimization would be to
not use string:str(Line, ">THREE Homo sapiens frequency"),
but rather to check whether the line actually starts
with ">THREE", thus:
case io:get_line('') of
">THREE" ++ _ -> found;
eof -> erlang:error(eof);
_ -> seek_three()
This tiny change alone gives a 18% speedup
on my machine.
> -----Original Message-----
> [mailto:] On Behalf Of
> Kenneth Johansson
> Sent: den 17 mars 2006 04:23
> Subject: The Computer Language Shootout
> I did an implementation in erlang for the knucleotide.
> And while the code is much shorter than C and fortran it's
> larger than ruby and python. But since this is my first real
> try at erlang I'm sure someone here can do significant improvement.
> Also the speed is a problem it's on my computer 8 times
> slower than the python version.
More information about the erlang-questions