[GHC] #13001: EnumFromThenTo is is not a good producer
GHC
ghc-devs at haskell.org
Thu Jan 5 11:55:44 UTC 2017
#13001: EnumFromThenTo is is not a good producer
-------------------------------------+-------------------------------------
Reporter: George | Owner:
Type: bug | Status: new
Priority: low | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: MacOS X | Architecture: x86_64
Type of failure: Runtime | (amd64)
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by akio):
> since GHC doesn't know c is strict, it'll allocate a thunk for the
second argument.
This is true. I was actually referring to another source of allocation:
since the call to `c` is under-saturated, evaluating this call involves
allocating a closure for the partial-application of `c`. This is also the
case when the final consumer is `foldl'` instead of `length`.
I think this is a general argument for marking *all* `FB` functions
`INLINE [0]`. If `p = build pFB` is advertised as a good producer, a user
would expect `foldl' f z p` to allocate no intermediate data structure.
However, if `pFB` is not inlined, this expression will necessarily
allocate a few closures for each eliminated cons cell.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13001#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list