[erlang-questions] slow file I/O (was Not an Erlang fan)

Ulf Wiger (TN/EAB) ulf.wiger@REDACTED
Thu Sep 27 17:15:55 CEST 2007


Steve Vinoski wrote:
> 
> So even with an elaborate program like this, Ruby still outperforms 
> Erlang by at least 2x, closer to 3x, and yet Ruby is generally slow 
> compared to Perl and Python. (Mind you, I use multiple programming 
> languages every day, so I'm not approaching this from a "my language is 
> better than yours" perspective. I don't have time for such nonsense.) 
> I'm just really trying to understand why file I/O has to be so slow 
> compared to these other languages. 

One reason is that file IO in Erlang has traditionally been
tuned in order to be as unobtrusive as possible, in massively
concurrent systems. For example, Mnesia's log dumps usually
run in the background at low priority in such systems, and
the more important IO is the signaling to/from the network.
In these systems, writes to disk are uncommon, and reading
large volumes of data from disk only occurs at restarts
(which are - hopefully - exceedingly uncommon).

While we've noticed for a long time that Erlang's IO generally
sucks in benchmarks that test raw sequential speed on one
large file or one socket, it hasn't been clear that this
adversely affects the key products using Erlang.

I'm sure that we can find ways to speed up such IO without
adversely affecting the characteristics of massively
concurrent IO. As Erlang is spreading more into other
application areas, this is bound to be a major issue.

BR,
Ulf W



More information about the erlang-questions mailing list