[GHC] #12150: Compile time performance degradation on code that uses undefined/error with CallStacks

GHC ghc-devs at haskell.org
Sat Jul 2 15:26:26 UTC 2016


#12150: Compile time performance degradation on code that uses undefined/error with
CallStacks
-------------------------------------+-------------------------------------
        Reporter:  thomie            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.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 Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by gridaphobe):

 Sorry to be so slow! I've finally had a chance to look at this..

 First of all, I can't reproduce the actual slowdown on my laptop

 {{{
 > python test.py
 tempfile = /var/folders/d0/j2pt98tx3pvcpdjghyx38c9c0000gn/T/tmpvwxkz4.hs
 N clauses : time (s)
 10        : 0.27
 20        : 0.31
 40        : 0.13
 80        : 0.13
 160       : 0.12
 320       : 0.12
 640       : 0.12
 1280      : 0.13
 }}}

 though the shrinking numbers makes me concerned that there may be some
 strange caching going on.. Ah, indeed, if I add `-fforce-recomp` I get
 something closer to your result

 {{{
 > python test.py
 tempfile = /var/folders/d0/j2pt98tx3pvcpdjghyx38c9c0000gn/T/tmpXChceI.hs
 N clauses : time (s)
 10        : 0.27
 20        : 0.31
 40        : 0.37
 80        : 0.55
 160       : 0.88
 320       : 1.55
 640       : 3.06
 1280      : 6.10
 }}}

 Second, I took a look at the generated Core, and while the '''desugared'''
 Core looks correct to me, the '''simplified''' Core has had the CallStacks
 inlined at each callsite, which is utterly pointless.

 In an earlier ticket (#10844) I investigated preventing CallStacks (and
 string literals) from being inlined, but the results were not very
 impressive so the patch stalled. Looks like I should take another look at
 it!

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


More information about the ghc-tickets mailing list