
Also, we do fusion on strict structures (e.g. vectors), where you get
back O(n) on each fused point. Obviously, it is less of a win on lazy
structures than the (pathological) case of strict data, but it is
still a win.
-- Don
On Tue, May 17, 2011 at 11:07 PM, Ben Lippmeier
On 18/05/2011, at 15:55 , Roman Cheplyaka wrote:
Of course I don't claim that fusion is useless -- just trying to understand the problem it solves. Are we saving a few closures and cons cells here?
And thunk allocations, and thunk entries. Entering a thunk costs upwards of 20 cycles, while performing a single addition should only cost one. Imagine every thunk entry is a function call. You don't want to call a whole function just to add two numbers together.
Those "few closures and cons cells" can be surprisingly expensive when compared to native ALU instructions on a modern machine.
Ben.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe