"I have a mind like a steel... uh... thingy." Patrick Logan's weblog.

Search This Blog

Thursday, September 27, 2007

When it rains, it pours i/o all over Erlang

klacke adds to the erlang i/o discussion as he did with the regexp discussion, with a faster library...

Originally at Bluetail, we had some serious problems with high performance file I/O, especially line oriented such.

I then wrote a portable (yes win32 too) linked in driver for fast FILE I/O. It's based on an old and hacked version of the BSD FILE* interface. It's called bfile and we've been using it in pretty much all projects during the past 8 years. I've prepared a tarball of it at


2> bfile:load_driver().
4> {ok, Fd} = bfile:fopen("Makefile", "r").
5> bfile:fgets(Fd).
6> bfile:fgets(Fd).
7> bfile:fgets(Fd).
14> bfile:fread(Fd, 10000).
15> bfile:fread(Fd, 10000).

1 comment:

Pichi said...

I'm not sure that bfile is significantly faster than file implementation, I think it's slower.

Blog Archive

About Me

Portland, Oregon, United States
I'm usually writing from my favorite location on the planet, the pacific northwest of the u.s. I write for myself only and unless otherwise specified my posts here should not be taken as representing an official position of my employer. Contact me at my gee mail account, username patrickdlogan.