[Haskell-cafe] Too much inlining on text package

Aleksey Khudyakov alexey.skladnoy at gmail.com
Fri Mar 16 17:22:21 CET 2012


On 16.03.2012 17:41, Felipe Almeida Lessa wrote:
> Does anyone have any ideas why GHC is inlining so much code
> everywhere?  While everything I said here was tested on GHC 7.0, we
> have evidence that GHC 7.4 suffers from the same problem.  We don't
> know about GHC 6.12, though.  This seems to be a problem for everyone
> who uses text, which we hope is everyone using Haskell ;-).
>
Disclaimer. I'm no expert in text internals.

Because it's told to do so. This is an unfortunate feature of stream 
fusion. It does eliminate intermediate data structures but it requires
that everything is inlined.

It looks like most of the code comes from unstream[1] function. I'm not 
sure that unstream has to be inlined. I suppose yes so stepper function 
is inlined.

[1] https://github.com/bos/text/blob/master/Data/Text/Fusion.hs#L95



More information about the Haskell-Cafe mailing list