computer language shootout

Josef Svenningsson
Mon, 30 Jul 2001 11:43:41 +0200 (MET DST)

On Mon, 30 Jul 2001, Simon Marlow wrote:

> I've looked at a few.  The most common factor in the worst performers
> seems to be the performance of String-related operations.  I tried
> converting a few to use PackedStrings but that didn't help much.  I
> suspect our PackedString implementation could do with some tuning, and
> we could gain considerable benefit from having an hGetLinePS function
> (like hGetLine but gets a PackedString).
Well, I think the common factor is I/O. The lazy I/O seems to be a real
bottleneck here. Trying to improve that would gain even more, I think.
I'm saying this because I did quite a bit of fiddling with some of the
examples (including trying PackedStrings). The conclusion I drew from
doing this was that the I/O performance was the problem.

Having said that I must also say that I think that ghc's I/O is fast
*enough*. It's just that it doesn't compare very well with other
languages. I've never had problems caused by slow I/O in Haskell.

Anyway, don't let this stop you from tuning and expanding that
PackedString library. I would love to see a PackedString library for
ghc which is as complete as hbc's ;-)