[GHC] #13395: 3x slowdown on GHC HEAD with file containing lots of overloaded string literals

#13395: 3x slowdown on GHC HEAD with file containing lots of overloaded string literals -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.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: -------------------------------------+------------------------------------- I just noticed that compiling `xmlhtml-0.2.3.5` from Hackage takes an extraordinarily long time on GHC HEAD. The slowdown can be attributed to the `Text.XmlHtml.HTML.Meta` module. I've extracted it and tweaked it so that it requires no dependencies to build (I now use `ByteString` instead of `Text`, but the slowdowns for both types were about the same.) On GHC 8.0.2, it takes about 3 seconds to compile the attached module: {{{ $ /usr/bin/time /opt/ghc/8.0.2/bin/ghc -fforce-recomp TextXmlHtmlHTMLMeta.hs [1 of 1] Compiling Text.XmlHtml.HTML.Meta ( TextXmlHtmlHTMLMeta.hs, TextXmlHtmlHTMLMeta.o ) 3.44user 0.07system 0:03.51elapsed 99%CPU (0avgtext+0avgdata 208480maxresident)k 0inputs+21688outputs (0major+43934minor)pagefaults 0swaps }}} But on GHC HEAD, it takes about 10 seconds: {{{ $ /usr/bin/time ~/Software/ghc2/inplace/bin/ghc-stage2 -fforce-recomp TextXmlHtmlHTMLMeta.hs [1 of 1] Compiling Text.XmlHtml.HTML.Meta ( TextXmlHtmlHTMLMeta.hs, TextXmlHtmlHTMLMeta.o ) 9.93user 0.11system 0:10.03elapsed 100%CPU (0avgtext+0avgdata 233656maxresident)k 0inputs+21464outputs (0major+54853minor)pagefaults 0swaps }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13395 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13395: 3x slowdown on GHC HEAD with file containing lots of overloaded string literals -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.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 RyanGlScott): * Attachment "TextXmlHtmlHTMLMeta.hs" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13395 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13395: 3x slowdown on GHC HEAD with file containing lots of overloaded string literals -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.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): That's bad! But it's '''so''' egregiously bad that surely it ought not to be hard to find where the time is going! Ben, Reid, David: might one of you look? If we can fix this we may fix other less-egregious cases. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13395#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13395: 3x slowdown on GHC HEAD with file containing lots of overloaded string literals -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.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): I took a look but on my systems it doesn't compile in anywhere near 3.5 seconds under GHC 8.0.2. It takes about 15 seconds for me and a recent (but not absolutely up-to-date) HEAD is similar. RyanGlScott are you sure about these numbers? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13395#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13395: 3x slowdown on GHC HEAD with file containing lots of overloaded string literals -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: invalid | 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 RyanGlScott): * status: new => closed * resolution: => invalid Comment: Ugh, it turns out this was caused by me using a GHC HEAD that was built with the `quick` flavor instead of the `perf` flavor. I had thought that the only difference between the two was that the latter built Haddocks and other non-essentials—that couldn't have been more wrong! After rebuilding GHC HEAD with `perf`, I get this time: {{{ $ /usr/bin/time ~/Software/ghc4/inplace/bin/ghc-stage2 -fforce-recomp TextXmlHtmlHTMLMeta.hs [1 of 1] Compiling Text.XmlHtml.HTML.Meta ( TextXmlHtmlHTMLMeta.hs, TextXmlHtmlHTMLMeta.o ) 3.08user 0.07system 0:03.17elapsed 99%CPU (0avgtext+0avgdata 196820maxresident)k 0inputs+21464outputs (0major+41873minor)pagefaults 0swaps }}} Which is even //better// than 8.0.2! So this tale had a happy ending after all. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13395#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC