You should try profiling this. I can see a few possible problems (such
as reading String from a socket, instead of a ByteString), but it's
difficult to predict what might be causing your code to be so slow.
Haskell code ought to be much more competitive with C for an
application like this.

I haven't tried profiling yet, I should do that (ugh, will prob
have to rebuild some libraries I'm using to support that).

Anyway, I haven't yet used any ByteString IO functions.  I ran
some tests when I was starting and it seems that using Handle IO
functions was a bit slower than using the Socket IO functions directly.
It looks like there are a bunch of Handle IO functions that can
return ByteStrings but I don't see any for sockets...  Are there any?
If not, I suspect it will be a wash switching to Handles and ByteStrings
(especially since most of my requests and responses are quite small).

I'll write up some tests to see how well those perform..

Tim Newsham
http://www.thenewsh.com/~newsham/
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to