Quantcast

[GHC] #13379: Space leak / quadratic behavior when inlining

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
37 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
           Reporter:  jberryman      |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           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:
-------------------------------------+-------------------------------------
 Compiling the attached example yields quadratic behavior and a big space
 leak (eventually the oom killer kills it) during inlining. Tested on both
 ghc 7.10.3 and 8.0.1

 I compiled with `-fforce-recomp --make -O2 -ddump-inlinings Main.hs`

 In cases where the process was able to run for a while I could see that
 each chunk of inlinings was getting slower linearly (every minute or so
 you can hit enter and which the line break go up your terminal a little
 slower than the last time). I assume the slowdown is due to GC over the
 growing heap due to a leak, but maybe the inlining algorithm is quadratic.

 Apologies if this is a dupe; I had trouble searching for similar issues.
 (I did find #13316 but don't understand if this could be related)

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379>
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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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:                    |
-------------------------------------+-------------------------------------
Changes (by jberryman):

 * Attachment "Main.hs" added.

 Main.hs

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379>
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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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 rwbarton):

 Even the space usage is quadratic, so something does seem amiss here. I
 recommend cutting the example down to at most 100 lines if you want to
 compile it in a reasonable amount of time.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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 dfeuer):

 I'm not too surprised this is a difficult case. `>>` is `infixl`. So we
 start with `(((f bs >> f b) >> f bs) >> f bs) >> f bs` and we end up
 (eventually) re-associating everything the other way. How did an example
 like this arise in practice?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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 jberryman):

 > How did an example like this arise in practice?

 In attempting to space profile some code where there seemed to be a
 constant small amount of allocation at each call site I tried creating a
 file like this one. I filed the bug because it seemed likely that this was
 evidence of performance issues in more realistic code.

 > I'm not too surprised this is a difficult case ... we end up
 (eventually) re-associating everything the other way

 Ah, interesting! This does seem to be related to `(>>)` and not the code I
 marked `INLINE` in the Main file. The code compiles quickly with:

 {{{
 import Prelude hiding ((>>))
 import qualified Prelude as P

 infixr 1 >>
 {-# NOINLINE (>>) #-}
 (>>) = (P.>>)
 }}}

 The NOINLINE is necessary, and we see `f` get inlined everywhere.

 But my naive response, knowing nothing about how to implement an inliner,
 and looking at a 191kb core file with a bunch of nested:

 {{{
     of _ [Occ=Dead] { (# ipv, ipv1 #) ->
     case hPutStr2 stdout ipv1 True ipv
     of _ [Occ=Dead] { (# ipv2, ipv3 #) ->
     case hPutStr2 stdout ipv1 True ipv2
     of _ [Occ=Dead] { (# ipv4, ipv5 #) ->
     case hPutStr2 stdout ipv1 True ipv4
     of _ [Occ=Dead] { (# ipv6, ipv7 #) ->
     case hPutStr2 stdout ipv1 True ipv6
     ...
 }}}

 ...is that I could do this inlining case manually in milliseconds (vs ~40
 seconds for whatever number of lines I was just testing with) with vim,
 sed, a bash script, etc. and without GB of memory for my working set. And
 so I am inclined to believe that there is a space leak here. Who knows if
 real code will benefit from fixing it though.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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 jberryman):

 These seem to be the slow inlinings which we don't see in the `infixr`
 variation I posted:

 {{{
 Inlining done: System.IO.putStrLn1
 Inlining done: GHC.IO.Handle.Text.hPutStrLn1
 Inlining done: GHC.Base.thenIO1
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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:                    |
-------------------------------------+-------------------------------------
Changes (by dfeuer):

 * cc: dfeuer (added)


Comment:

 If the `NOINLINE` is necessary, then I think I must be quite wrong about
 the source of the problem.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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 mpickering):

 I think that the problem is that `>>` and then `thenIO` gets inlined which
 in this case causes the compiler to generate heaps of code to simplify. I
 tried using `Identity` and it compiled instantly.

 It seems plausible that that this shouldn't take a long time but more
 investigation into what exactly is taking a long time is needed.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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 jberryman):

 Still looking into this slowly when I have time. It looks like this is a
 regression between ghc-7.10 and 8.0.1 at least. Here e.g. `# 50 lines` etc
 refers to 50 lines of

 {{{
 f bs >> f bs >> f bs >> f bs >> f bs >> f bs >> f bs >> f bs >> f bs >> f
 bs >> f bs >> f bs >> f bs >> f bs >> f bs >> f bs >>
 }}}

 With ghc 7.10 this looks slow but linear:

 {{{
 jberryman /tmp/again » time ghc-7.10.3  -fforce-recomp -O2 Main.hs # 25
 lines
 [1 of 1] Compiling Main             ( Main.hs, Main.o )
 Linking Main ...
 ghc-7.10.3 -fforce-recomp -O2 Main.hs  0.90s user 0.09s system 97% cpu
 1.018 total
 jberryman /tmp/again » time ghc-7.10.3  -fforce-recomp -O2 Main.hs # 50
 lines
 [1 of 1] Compiling Main             ( Main.hs, Main.o )
 Linking Main ...
 ghc-7.10.3 -fforce-recomp -O2 Main.hs  1.59s user 0.13s system 98% cpu
 1.744 total
 jberryman /tmp/again » time ghc-7.10.3  -fforce-recomp -O2 Main.hs # 100
 lines
 [1 of 1] Compiling Main             ( Main.hs, Main.o )
 Linking Main ...
 ghc-7.10.3 -fforce-recomp -O2 Main.hs  3.87s user 0.25s system 99% cpu
 4.146 total
 }}}

 And in 8.0 we have a regression and what looks like worse asymptotics:

 {{{
 jberryman /tmp/again » time ghc  -fforce-recomp -O2 Main.hs # 25 lines
 [1 of 1] Compiling Main             ( Main.hs, Main.o )
 Linking Main ...
 ghc -fforce-recomp -O2 Main.hs  2.41s user 0.15s system 99% cpu 2.583
 total
 jberryman /tmp/again » time ghc  -fforce-recomp -O2 Main.hs # 50 lines
 [1 of 1] Compiling Main             ( Main.hs, Main.o )
 Linking Main ...
 ghc -fforce-recomp -O2 Main.hs  7.36s user 0.21s system 99% cpu 7.586
 total
 jberryman /tmp/again » time ghc  -fforce-recomp -O2 Main.hs # 100 lines
 [1 of 1] Compiling Main             ( Main.hs, Main.o )
 Linking Main ...
 ghc -fforce-recomp -O2 Main.hs  27.99s user 0.45s system 99% cpu 28.463
 total
 jberryman /tmp/again » time ghc  -fforce-recomp -O2 Main.hs # 200 lines
 [1 of 1] Compiling Main             ( Main.hs, Main.o )
 Linking Main ...
 ghc -fforce-recomp -O2 Main.hs  122.58s user 6.40s system 84% cpu 2:33.50
 total
 }}}

 Also attached profiles using the ghc library via
 https://gist.github.com/nominolo/d18efaabf3e074d03969

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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:                    |
-------------------------------------+-------------------------------------
Changes (by jberryman):

 * Attachment "ghc-wrap.hy.7.10.pdf" added.


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379>
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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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:                    |
-------------------------------------+-------------------------------------
Changes (by jberryman):

 * Attachment "ghc-wrap.h.7.10.pdf" added.


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379>
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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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:                    |
-------------------------------------+-------------------------------------
Changes (by jberryman):

 * Attachment "ghc-wrap.hy.8.0.pdf" added.


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379>
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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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:                    |
-------------------------------------+-------------------------------------
Changes (by jberryman):

 * Attachment "ghc-wrap.h.8.0.pdf" added.


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379>
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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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:                    |
-------------------------------------+-------------------------------------
Changes (by MikolajKonarski):

 * cc: MikolajKonarski (added)


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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 dfeuer):

 I'm working on bisecting this now. Unfortunately, the version/time
 function is far from monotone, so there may well be multiple issues
 involved.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            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 dfeuer):

 All right. I believe I've pinned this down to
 45d9a15c4b85a2ed89579106bdafd84accf2cb39 ("Fix a huge space leak in the
 mighty Simplifier").

 * Before: 2.5GB allocated in 4.3s
 * After: 28.2GB allocated in 19s

 That's over ten times the allocation, and over 4 times the time! I'll
 start taking a look at why that may be.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  Inlining
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 simonpj):

 * keywords:   => Inlining


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  Inlining
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13586            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by MikolajKonarski):

 * related:   => #13586


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  Inlining
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13586            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 The first weird thing to notice about this problem is that
 45d9a15c4b85a2ed89579106bdafd84accf2cb39 is all about LHSes of `RULES`,
 but there ''aren't any'' rules in the test module. So something seems to
 have gone wrong with one of the "knock on" changes.

 Compiling before and after with `-v3` indicates that the simplifier
 iteration immediately after float out takes ''much'' longer, and produces
 somewhat more coercions. That iteration takes many times longer than any
 other. Most of the coercions, before and after, go away after that
 iteration, stabilizing quickly at 19. Surprisingly, `-dverbose-core2core`
 looks exactly the same before and after that commit, suggesting something
 went funny with the size calculations, although I can't see how.

 In HEAD, the number of coercions never goes up above 19. Furthermore, the
 time problem has ''moved''. Now, the long iteration is the very first one
 after desugaring! Ugh. I haven't yet tried to find where the time shift
 took place. But the fact that there ''was'' one makes me suspect that the
 new implementation could have accidentally strictified something it
 shouldn't have. I don't understand what's going on well enough to know
 what. Perhaps the fact that a couple pure functions have turned monadic?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
|  
Report Content as Inappropriate

Re: [GHC] #13379: Space leak / quadratic behavior when inlining

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13379: Space leak / quadratic behavior when inlining
-------------------------------------+-------------------------------------
        Reporter:  jberryman         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  Inlining
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13586            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by MikolajKonarski):

 > In HEAD [...] the time problem has moved. Now, the long iteration is the
 very first one after desugaring

 May it have anything to do with the "early inlining" changes?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13379#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
12
Loading...