[GHC] #14519: Exponential runtime performance regression in GHC 8.2 + Data.Text.Lazy + Text.RE.TDFA

GHC ghc-devs at haskell.org
Wed Jan 17 15:26:41 UTC 2018


#14519: Exponential runtime performance regression in GHC 8.2 + Data.Text.Lazy +
Text.RE.TDFA
-------------------------------------+-------------------------------------
        Reporter:  ntc2              |                Owner:  tdammers
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Runtime           |            Test Case:
  performance bug                    |  https://github.com/ntc2/ghc-8.2.1
                                     |  -regex-lazy-text-
                                     |  bug/tree/07b7bb32c6e90e8f2d2eada4b59943f37e632d53
      Blocked By:                    |             Blocking:
 Related Tickets:  #13745, #14564    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by tdammers):

 Evidence so far:

 - We already suspected that whatever we're doing in `uncons` for lazy
 `Text` might break things.
 - The `next` function, which uses `uncons` a lot, is where things blow up
 in ticky profiles
 - Problem disappears when disabling rewrite rules.
 - Problem also disappears in profiling builds; this may however be due to
 rewrites and other optimizations not being fully applied in the presence
 of explicit cost centres.
 - Some `RULES` wrt `Text` fusion appear in the dump.

 So, updated hypothesis: This may not actually be a bug in GHC itself, but
 in the `text` library, particularly the fusion-related rules. Things like
 [https://github.com/haskell/text/pull/200 this PR] support the idea that
 `text`'s fusion behavior may not be perfect yet.

 If this is the case, then disabling the relevant RULES in `text` should
 also make the problem disappear.

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


More information about the ghc-tickets mailing list