[GHC] #7450: Regression in optimisation time of functions with many patterns (6.12 to 7.4)?

GHC ghc-devs at haskell.org
Mon Jul 6 08:48:15 UTC 2015


#7450: Regression in optimisation time of functions with many patterns (6.12 to
7.4)?
-------------------------------------+-------------------------------------
        Reporter:  iustin            |                   Owner:  bgamari
            Type:  bug               |                  Status:  patch
        Priority:  normal            |               Milestone:  7.12.1
       Component:  Compiler          |                 Version:  7.6.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:  Phab:D1012
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"4681f55970cabc6e33591d7e698621580818f9a2/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="4681f55970cabc6e33591d7e698621580818f9a2"
 Specialise: Avoid unnecessary recomputation of free variable information

 When examining compile times for code with large ADTs (particularly those
 with
 many record constructors), I found that the specialiser contributed
 disproportionately to the compiler runtime. Some profiling suggested that
 the a great deal of time was being spent in `pair_fvs` being called from
 `consDictBind`.

 @simonpj pointed out that `flattenDictBinds` as called by `specBind` was
 unnecessarily discarding cached free variable information, which then
 needed to
 be recomputed by `pair_fvs`.

 Here I refactor the specializer to retain the free variable cache whenever
 possible.

 **Open Qustions**

  * I used `fst` in a couple of places to extract the bindings from a
 `DictBind`.
    Perhaps this is a sign that `DictBind` has outgrown its type synonym
 status?

 Test Plan: validate

 Reviewers: austin, simonpj

 Reviewed By: simonpj

 Subscribers: thomie, bgamari, simonpj

 Differential Revision: https://phabricator.haskell.org/D1012

 GHC Trac Issues: #7450
 }}}

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


More information about the ghc-tickets mailing list