[GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
           Reporter:  phadej         |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 See the attached file. The compilation time grows exponentially with
 additional fields in `HuteStruct`. Tried with GHC-8.0.1 and quite recent
 HEAD (8.2)

 adding a field doubles the compilation time with `-O2`.
 - 9: 17s
 - 10: 34s
 - 11: 83s
 on my machine. With `-01` around 3sec, independently of the struct size.

 The original issue: https://github.com/yesodweb/yesod/issues/1348

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13253>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by phadej):

 * Attachment "bad.hs" added.

 Example file

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13253>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by mpickering):

 We suspect the problem is that `<*>` for `RWST` is marked as `INLINE` in
 transformers. This ticket is to check whether that is the case and then
 decide on the course of action.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13253#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Exponential is bad.  Why would marking it INLINE make things go
 exponential?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13253#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 Looks like the same as #10421. Unfortunately I didn't upload the modules
 `Form` and `Y` used in the reproducer there, and I can't find copies of
 them on my system.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13253#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 But note that #10421 doesn't appear to involve transformers; the only
 monad involved is `IO`. (Though I don't have the definitions of `mreq`,
 `mopt` or `FormResult`.)

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13253#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by phadej):

 rwbarton: I suspect mreq and FormResult are the similar to ones in my
 attachment (which are originally from yesod, but stripped out of stuff).

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13253#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by ocharles):

 * cc: ocharles (added)


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13253#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 It would be good to get to the point where we can reproduce this.
 Exponential is bad.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by phadej):

 Simon, see the `bad.hs` attached. I can see the expontential behaviour
 with current `HEAD` too. Remember to use `-O2`.
 {{{
 time .../bin/ghc-stage2 -O2 -fforce-recomp       bad.hs # 38sec
 time .../bin/ghc-stage2 -O2 -fforce-recomp -DBIG bad.hs # 3min 16sec

 time .../bin/ghc-stage2 -O1 -fforce-recomp       bad.hs # 9.8sec
 time .../bin/ghc-stage2 -O1 -fforce-recomp -DBIG bad.hs # 9.9sec
 }}}

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 See #10421 for another example.  We should investigate this!

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       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:                    |
-------------------------------------+-------------------------------------
Changes (by bgamari):

 * failure:  None/Unknown => Compile-time performance bug
 * milestone:   => 8.4.1


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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       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:                    |
-------------------------------------+-------------------------------------
Changes (by bgamari):

 * owner:  (none) => dfeuer


Comment:

 David, perhaps you could look into this?

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       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 mpickering):

 Reverting 1722fa106e10e63160bb2322e2ccb830fd5b9ab3 improves the situation
 somewhat but -DBIG is still quite a bit slower.

 Pre-revert
 12s without -DBIG
 1m12 with -DBIG

 Post-revert
 8s without -DBIG
 28s with -DBIG

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       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 mpickering):

 Adding an extra field leads to

 {{{
 8714 UnfoldingDone
   8201 $c<*>_a4Ng
 }}}

 So each extra field leads to double the number of `<*>`s being inlined and
 hence the exponential behaviour.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       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 mpickering):

 Adding a `NOINLINE` to `<*>` for `FormResult` predictably fixes the
 problem.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       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 mpickering):

 Looking at the n=2 case for simplicity.

 At one stage of the compilation we have some core which looks like

 {{{
 ($c<*>_a4dL
                (case x01_a2dZ of {
                   FormMissing -> FormMissing;
                   FormFailure errs_a2dS -> FormFailure errs_a2dS;
                   FormSuccess a_a2dU ->
                     FormSuccess
                       (\ dt_a2M6 ->
                          case a_a2dU of dt_X2M8 { PS ipv_s5JI ipv_s5JJ
 ipv_s5JK ipv_s5JL ->
                          case dt_a2M6 of dt_X2Ma { PS ipv_s5JO ipv_s5JP
 ipv_s5JQ ipv_s5JR ->
                          HugeStruct dt_X2M8 dt_X2Ma
                          }
                          })
                 })
                x02_a2e0
 }}}

 Next thing we know, the expression has been commuted and the call to $c<*>
 has been pushed into the branches !?

 {{{

  (case x01_a2dZ of {
                FormMissing -> $c<*>_a4dL FormMissing x02_a2e0;
                FormFailure errs_a2dS ->
                  $c<*>_a4dL (FormFailure errs_a2dS) x02_a2e0;
                FormSuccess a_a2dU ->
                  $c<*>_a4dL
                    (FormSuccess
                       (\ dt_a2M6 ->
                          case a_a2dU of dt_X2M8 { PS ipv_s5JI ipv_s5JJ
 ipv_s5JK ipv_s5JL ->
                          case dt_a2M6 of dt_X2Ma { PS ipv_s5JO ipv_s5JP
 ipv_s5JQ ipv_s5JR ->
                          HugeStruct a_a2dU dt_a2M6
                          }
                          }))
                    x02_a2e0
 }}}

 and then `$c<*>_a4dL` is inlined individually in each branch rather than
 once at the top level.

 I don't know where in the compiler performs this transformation, perhaps
 you know where it happens David?

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       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 mpickering):

 The reason why `-O2` is needed is because an extra pass of the simplifer
 is ran after the `-fliberate-case` pass. If you don't run this extra pass,
 there are lots of uninlined calls to `c<*>` left over.

 The core running with `-O` is here. Starting on about line 950 you can see
 all the nested calls to `<*>` which have been duplicated.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       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 mpickering):

 The code duplication alluded to in comment:12 is a result of the special
 case in `rebuildCall` for a strict argument.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       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 simonpj):

 > The code duplication alluded to in comment:12 is a result of the special
 case in rebuildCall for a strict argument.

 Can you elaborate on how that special case duplicates code?

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
12