[Haskell-cafe] Is fusion overrated?

Ben Lippmeier benl at ouroborus.net
Wed May 18 08:07:03 CEST 2011

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.


More information about the Haskell-Cafe mailing list