[Haskell-cafe] forLoop + strict State monad is much faster than foldl'

Joachim Breitner mail at joachim-breitner.de
Wed Apr 30 11:42:36 UTC 2014


Hi,

Am Dienstag, den 29.04.2014, 18:16 -0700 schrieb John Lato:

> So this is interesting.  The forLoop code gets compiled into a nice
> loop in core over unboxed Ints.  The foldl' function OTOH still goes
> via a list.  I expect it's not foldl' itself that's slow, rather that
> it doesn't fuse with the list producers in current GHCs.  This may be
> improved in the future.  Especially as the vectorized foldl' does
> fuse.

This should have improved in GHC 7.9, where I have fixed
https://ghc.haskell.org/trac/ghc/ticket/7994 (making foldl a good
consumer).

Greetings,
Joachim

-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata at debian.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140430/312e0864/attachment.sig>


More information about the Haskell-Cafe mailing list