[GHC] #7994: Make foldl into a good consumer

GHC ghc-devs at haskell.org
Wed Jan 29 17:37:34 UTC 2014


#7994: Make foldl into a good consumer
-------------------------------------+------------------------------------
        Reporter:  simonpj           |            Owner:
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.6.3
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by nomeata):

 With the patch above, the benefits from foldl-via-buildr and the call
 arity analysis are
 {{{
             Min          -0.2%    -74.5%     -9.6%    -10.6%    -50.0%
             Max          +0.9%     +1.7%     +4.1%     +4.1%     +6.3%
  Geometric Mean          -0.0%     -4.0%     -0.6%     -0.7%     -0.7%
 }}}
 with only one increase: `nucleic2`. It comes from a use of `maximum`, and
 it goes away when that is changed from `NOINLINE [1]` to `INLINE [1]` (GHC
 was inlining `maximum` while `foldl` was implemented naively, but not any
 more, so let's give it a push). Then we get the very pleasing result of no
 single benchmark with allocation increase:
 {{{
             Min          -0.1%    -74.5%     -6.8%     -8.3%    -50.0%
             Max          +0.2%      0.0%    +38.5%    +38.5%      0.0%
  Geometric Mean          -0.0%     -4.1%     +7.7%     +7.7%     -0.8%
 }}}

 This is the current state in the branch `wip/T7994-calledArity` of ghc,
 and the branch `wip/T7994` of base.

 The effect on compilation times needs to be measured, and quite possibly
 improved (e.g. not a full simplifier run after it, but only eta-expansion
 where possible and then a gentle simplification of the RHS).

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7994#comment:15>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list