Re: [Haskell-cafe] Fast number parsing with strict bytestrings [Was: Re: Seemingly subtle change causes large performance variation]

2007-06-08 Thread Donald Bruce Stewart
conal: > >Lovely! > >Perhaps a stylistic shift would encourage writing this sort >of elegant, fusion-friendly code. >-- Generalized version of "interact". Encapsulates data >getter & putter. >genInteract :: IO i -> (o -> IO ()) -> ((i -> o) -> IO >()) >

Re: [Haskell-cafe] Fast number parsing with strict bytestrings [Was: Re: Seemingly subtle change causes large performance variation]

2007-06-08 Thread Conal Elliott
Lovely! Perhaps a stylistic shift would encourage writing this sort of elegant, fusion-friendly code. -- Generalized version of "interact". Encapsulates data getter & putter. genInteract :: IO i -> (o -> IO ()) -> ((i -> o) -> IO ()) genInteract get put = \ f -> get >>= put . f The in

Re: [Haskell-cafe] Fast number parsing with strict bytestrings [Was: Re: Seemingly subtle change causes large performance variation]

2007-06-08 Thread Bulat Ziganshin
Hello Donald, Friday, June 8, 2007, 5:42:41 AM, you wrote: > Previous experience[1] indicates it is pretty hard to write a C line > parsing program[2] that that run this fast. And the code, with comments: [2] uses gets() function while your haskell code read whole buffer each time. that is the

Re: [Haskell-cafe] Fast number parsing with strict bytestrings [Was: Re: Seemingly subtle change causes large performance variation]

2007-06-07 Thread Donald Bruce Stewart
dons: > dons: > > mdanish: > > > Hello, > > > > > > I've been playing with the INTEST problem on SPOJ which demonstrates > > > the ability to write a program which processes large quantities of > > > input data. http://www.spoj.pl/problems/INTEST/ > > > > > But when I make a slight modificatio

Re: [Haskell-cafe] Fast number parsing with strict bytestrings [Was: Re: Seemingly subtle change causes large performance variation]

2007-06-07 Thread Donald Bruce Stewart
dons: > mdanish: > > Hello, > > > > I've been playing with the INTEST problem on SPOJ which demonstrates > > the ability to write a program which processes large quantities of > > input data. http://www.spoj.pl/problems/INTEST/ > > > But when I make a slight modification, the program chews up

[Haskell-cafe] Fast number parsing with strict bytestrings [Was: Re: Seemingly subtle change causes large performance variation]

2007-06-07 Thread Donald Bruce Stewart
mdanish: > Hello, > > I've been playing with the INTEST problem on SPOJ which demonstrates > the ability to write a program which processes large quantities of > input data. http://www.spoj.pl/problems/INTEST/ > But when I make a slight modification, the program chews up a ton more memory > an