[erlang-questions] I/O performance when reading from stdin

Hynek Schlawack <>
Sat Jan 10 18:36:54 CET 2009


Hi,

I'm starting to learn and love Erlang and wanted as a small exercise
implement a word occurrence counter for http://ptrace.fefe.de/wp/ .

To say it kindly, Erlang isn't built for string operations. :) My
(mostly approved by #erlang) version[1] is twice as slow as the slowest
already submitted[2].

Anyway, I encountered a rather strange effect I'd like to ask about:
When I read from stdin, the program takes twice the time and memory
compared to the case when I open the file myself. Any hints? Is it a
bug? Isn't it just the "intended use" of Erlang and nobody cares? The
effect occurs under Linux, haven't tested it elsewhere.

Thanks!
Hynek
-- 
[1] http://github.com/hynek/wp-erlang/tree/master/wp.erl
[2] http://ptrace.fefe.de/wp/timings.txt




More information about the erlang-questions mailing list