[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 13:37:17 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):

 Compiling with -ddump-rule-firings gives us:
 {{{
 Rule fired: Class op toEnum (BUILTIN)
 Rule fired: Class op toEnum (BUILTIN)
 Rule fired: Class op before (BUILTIN)
 Rule fired: Class op after (BUILTIN)
 Rule fired: LAZY TEXT drop -> fused (Data.Text.Lazy)
 Rule fired: LAZY TEXT take -> fused (Data.Text.Lazy)
 Rule fired:
     LAZY STREAM stream/unstream fusion (Data.Text.Internal.Lazy.Fusion)
 Rule fired: Class op makeRegexOptsM (BUILTIN)
 Rule fired: Class op $p1RegexMaker (BUILTIN)
 Rule fired: Class op makeRegexOptsM (BUILTIN)
 Rule fired: Class op defaultCompOpt (BUILTIN)
 Rule fired: Class op defaultExecOpt (BUILTIN)
 Rule fired: Class op makeRegexOptsM (BUILTIN)
 Rule fired: Class op $p1RegexMaker (BUILTIN)
 Rule fired: Class op makeRegexOpts (BUILTIN)
 Rule fired: Class op defaultCompOpt (BUILTIN)
 Rule fired: Class op defaultExecOpt (BUILTIN)
 Rule fired: unpack (GHC.Base)
 Rule fired: Class op show (BUILTIN)
 Rule fired: ++ (GHC.Base)
 Rule fired: fold/build (GHC.Base)
 Rule fired: Class op fmap (BUILTIN)
 Rule fired: Class op matchOnce (BUILTIN)
 Rule fired: Class op bounds (BUILTIN)
 Rule fired: Class op unsafeAt (BUILTIN)
 Rule fired: Class op numElements (BUILTIN)
 Rule fired: Class op index (BUILTIN)
 Rule fired: Class op before (BUILTIN)
 Rule fired: LAZY TEXT take -> fused (Data.Text.Lazy)
 Rule fired: Class op fmap (BUILTIN)
 Rule fired: Class op extract (BUILTIN)
 Rule fired: Class op after (BUILTIN)
 Rule fired: Class op + (BUILTIN)
 Rule fired: LAZY TEXT drop -> fused (Data.Text.Lazy)
 Rule fired: Class op length (BUILTIN)
 Rule fired: Class op matchAll (BUILTIN)
 Rule fired: length (GHC.List)
 Rule fired: unpack (GHC.Base)
 Rule fired: unpack (GHC.Base)
 Rule fired: unpack (GHC.Base)
 Rule fired: unpack (GHC.Base)
 Rule fired: Class op bounds (BUILTIN)
 Rule fired: Class op unsafeAt (BUILTIN)
 Rule fired: Class op numElements (BUILTIN)
 Rule fired: Class op index (BUILTIN)
 Rule fired: Class op fmap (BUILTIN)
 Rule fired: Class op extract (BUILTIN)
 Rule fired: Class op - (BUILTIN)
 Rule fired: Class op after (BUILTIN)
 Rule fired: Class op + (BUILTIN)
 Rule fired: Class op - (BUILTIN)
 Rule fired: LAZY TEXT drop -> fused (Data.Text.Lazy)
 Rule fired: Class op + (BUILTIN)
 Rule fired: Class op matchAll (BUILTIN)
 Rule fired: Class op matchAll (BUILTIN)
 Rule fired: Class op matchOnceText (BUILTIN)
 Rule fired: Class op bounds (BUILTIN)
 Rule fired: Class op unsafeAt (BUILTIN)
 Rule fired: Class op numElements (BUILTIN)
 Rule fired: Class op index (BUILTIN)
 Rule fired: Class op numElements (BUILTIN)
 Rule fired: Class op unsafeAt (BUILTIN)
 Rule fired: map (GHC.Base)
 Rule fired: Class op matchOnce (BUILTIN)
 Rule fired: Class op matchOnceText (BUILTIN)
 Rule fired: Class op $p1Integral (BUILTIN)
 Rule fired: Class op $p1Real (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op $p2Real (BUILTIN)
 Rule fired: Class op <= (BUILTIN)
 Rule fired: Class op - (BUILTIN)
 Rule fired: Class op <= (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op - (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op toInteger (BUILTIN)
 Rule fired: smallIntegerToInt (BUILTIN)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: Class op $p1Integral (BUILTIN)
 Rule fired: Class op $p1Real (BUILTIN)
 Rule fired: Class op $p2Real (BUILTIN)
 Rule fired: Class op toInteger (BUILTIN)
 Rule fired: smallIntegerToInt (BUILTIN)
 Rule fired: Class op $p1Integral (BUILTIN)
 Rule fired: Class op $p1Real (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op $p2Real (BUILTIN)
 Rule fired: Class op <= (BUILTIN)
 Rule fired: Class op - (BUILTIN)
 Rule fired: Class op <= (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op - (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op toInteger (BUILTIN)
 Rule fired: smallIntegerToInt (BUILTIN)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: SPEC next @ Int64 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: Class op $p1Integral (BUILTIN)
 Rule fired: Class op $p1Real (BUILTIN)
 Rule fired: Class op $p2Real (BUILTIN)
 Rule fired: Class op toInteger (BUILTIN)
 Rule fired: smallIntegerToInt (BUILTIN)
 Rule fired: Class op $p1RegexLike (BUILTIN)
 Rule fired: Class op empty (BUILTIN)
 Rule fired: Class op matchOnceText (BUILTIN)
 Rule fired: Class op $p1RegexLike (BUILTIN)
 Rule fired: Class op matchOnceText (BUILTIN)
 Rule fired: Class op empty (BUILTIN)
 Rule fired:
     SPEC/Text.Regex.TDFA.Text.Lazy polymatch @ Regex @ Text
 (Text.Regex.TDFA.Text.Lazy)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: foldr/app (GHC.Base)
 Rule fired: unpack-append (GHC.Base)
 Rule fired: foldr/app (GHC.Base)
 Rule fired: unpack-append (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: foldr/app (GHC.Base)
 Rule fired: unpack-append (GHC.Base)
 Rule fired: foldr/app (GHC.Base)
 Rule fired: unpack-append (GHC.Base)
 Rule fired: lengthList (GHC.List)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: foldr/app (GHC.Base)
 Rule fired: unpack-append (GHC.Base)
 Rule fired: foldr/app (GHC.Base)
 Rule fired: unpack-append (GHC.Base)
 Rule fired: mapList (GHC.Base)
 Rule fired: unpack-list (GHC.Base)
 Rule fired: unpack-append (GHC.Base)
 Rule fired: Class op $p1Integral (BUILTIN)
 Rule fired: Class op $p1Real (BUILTIN)
 Rule fired: Class op $p2Real (BUILTIN)
 Rule fired: Class op $p1Integral (BUILTIN)
 Rule fired: Class op $p1Real (BUILTIN)
 Rule fired: Class op $p2Real (BUILTIN)
 Rule fired: Class op <= (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op - (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op <= (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op - (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op toInteger (BUILTIN)
 Rule fired: smallIntegerToInt (BUILTIN)
 Rule fired: Class op $p1Integral (BUILTIN)
 Rule fired: Class op $p1Real (BUILTIN)
 Rule fired: Class op $p2Real (BUILTIN)
 Rule fired: Class op toInteger (BUILTIN)
 Rule fired: smallIntegerToInt (BUILTIN)
 Rule fired: Class op $p1Integral (BUILTIN)
 Rule fired: Class op $p1Real (BUILTIN)
 Rule fired: Class op $p2Real (BUILTIN)
 Rule fired: Class op <= (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op - (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op <= (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op - (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op $p1Integral (BUILTIN)
 Rule fired: Class op $p1Real (BUILTIN)
 Rule fired: Class op $p2Real (BUILTIN)
 Rule fired: Class op <= (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op - (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op <= (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: Class op - (BUILTIN)
 Rule fired: Class op fromInteger (BUILTIN)
 Rule fired: integerToInt (BUILTIN)
 Rule fired: *# (BUILTIN)
 Rule fired: *# (BUILTIN)
 }}}

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


More information about the ghc-tickets mailing list