On Wed, Mar 14, 2012 at 5:50 PM, wren ng thornton <w...@freegeek.org> wrote:
> Do note, however, that in certain cases the ST approach can be much slower
> than the obvious immutable approach (i.e., the State monad--- especially
> when implemented directly via argument passing, rather than using the
> monadic interface). I have some closed-source code where that assumption bit
> me; the ST code was over 4x slower.

An additional reason is that runST often allocates a closure (as it's
marked NOINLINE) and thus using it e.g. in a tight loop can increase
allocation.

-- Johan

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to