[GHC] #9557: Deriving instances is slow

GHC ghc-devs at haskell.org
Sun Sep 21 18:15:08 UTC 2014


#9557: Deriving instances is slow
-------------------------------------+-------------------------------------
              Reporter:  Feuerbach   |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.8.3
            Resolution:              |         Keywords:
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:              |       Blocked By:
  None/Unknown                       |  Related Tickets:  #8731
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 It undoubtedly is a bit unexpected if simply adding `deriving( Show )` or
 whatever, which seems such a little thing, generates seriously large
 amounts of object code.

 If someone feels able to investigate I would suggest:
  * Find out if any particular class is to blame.  How much of the code is
 generated by which classes?
  * Study the generated code to see if it could be abstracted, so that
 instead of lots of code, there were calls to some suitable shared
 functions.

 Obviously there is a performance/code-size issue to worry about, but my
 guess is that while `Eq` and `Ord` might be performance-critical, `Read`
 and `Show` are not.

 But it would require some thoughtful investigation.

 Simon

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


More information about the ghc-tickets mailing list