Oh, I didn't realize how much of a difference it would make.  Thanks a
lot!

-- Joseph Re 

-----Original Message-----
From: Salvatore Insalaco [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 20, 2007 12:21 PM
To: Tillmann Rendel
Cc: Re, Joseph (IT); haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] Speedy parsing

2007/7/20, Tillmann Rendel <[EMAIL PROTECTED]>:
> Re, Joseph (IT) wrote:
> > At this point I'm out of ideas, so I was hoping someone could 
> > identify something stupid I've done (I'm still novice of FP in 
> > general, let alone for high performance) or direct me to a 
> > guide,website,paper,library, or some other form of help.

I think that your problem is simply an excess of lazyness :).
foldr is too lazy: you pass huge structures to fold, that you evaluate
anyway.
Try to import Data.List and use foldl' (not foldl), that is strict.
Being left fold, you probably need to rework a bit your functions (I
tried to simply flip them, but the result of the program wereflipped
too), but the time (and memory) difference is unbelievabl (foldl' is
constant in memory allocation).

Salvatore
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to