The Great Computer Language Shootout is back

Mark Scandariato mscandar@REDACTED
Wed Jul 28 19:48:31 CEST 2004


I hadn't tried native compilation: turns out that it cuts the time in half:

 > erlc  wc.erl
 > time erl -noshell -run wc start < 4MB.txt
111037  692748  4194304
1.040u 0.040s 0:01.09 99.0%     0+0k 0+0io 873pf+0w

 > erlc +native wc.erl
 > time erl -noshell -run wc start < 4MB.txt
111037  692748  4194304
0.440u 0.030s 0:00.47 100.0%    0+0k 0+0io 881pf+0w

which beats the wc that comes with redhat:
 > time wc 4MB.txt
111037  692748 4194304 4MB.txt
0.640u 0.000s 0:00.59 108.4%    0+0k 0+0io 142pf+0w

Mark.
Isaac Gouy wrote:

> --- Mark Scandariato <mscandar@REDACTED> wrote:
> 
>>Try this one. Seems about the same speed as the other version.
>>I tried it on a 4 MB test file (on a 2.4GHz P4, Redhat 9) and it took
>>about 1 second, exclusive of erlang's startup time. 
>>(The native wc took about .67s).
> 
> 
> What command line are you using?
> 
>    erlc +native wc.erl
>    erl -noinput -s wc start < input.txt
> 
>    {"init terminating in   
>   
> do_boot",{undef,[{wc,start,[]},{init,start_it,1},{init,start_em,1}]}}
> 
>    Crash dump was written to: erl_crash.dump
>    init terminating in do_boot ()
> 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail



More information about the erlang-questions mailing list