openFile and threads

Simon Marlow
Fri, 10 Jan 2003 16:38:59 -0000

> > You might consider bypassing the Handle interface and going=20
> to the bare
> > metal using the Posix library, which will cut down on the=20
> overhead in
> > openFile.
> That's what I was fearing. Is the conversion from Haskell Strings to
> C strings a performance problem?

Haskell Strings are a common performance bottleneck; for example when
serving files in the Haskell web server I avoided the conversion to
Haskell Strings altogether by reading/writing arrays of bytes (see the
paper for details).

But it sounds like in your case you need to open lots of (small?) files.
What do you do with the contents of the files?