[Haskell-beginners] Help with slow algorithm

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Fri May 14 21:23:50 EDT 2010


On May 14, 2010, at 21:13 , Diego Echeverri wrote:
> I have learnt a bunch of things doing this exercise but I'm still
> getting time-limit exception.
>
> Here's the code: http://gist.github.com/401880
>
> I believe that the bottleneck is in the addOne function (Specially in
> the case where you have a bunch of nines). I have rewritten it to use
> STArray but isn't fast enough.
> doing: addOne $ B.replicate 500000 'a' takes too much time!

http://www.haskell.org/haskellwiki/Performance/GHC is the place to  
start.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/beginners/attachments/20100514/ba6a8eab/PGP.bin


More information about the Beginners mailing list