Skip to content

Investigate compile-time regressions in regex-tdfa-1.2.2

hvr points out that GHC 8.2 takes significantly longer to compile regex-tdfa-1.2.2 than 8.0.2. Interestingly, it seems that compiler allocations fell dramatically while compilation time rose.

GHC 8.0.2:

<<ghc: 89544610040 bytes, 2301 GCs, 189183965/391103872 avg/max bytes
residency (29 samples), 1075M in use, 0.001 INIT (0.001 elapsed),
55.747 MUT (61.520 elapsed), 23.276 GC (23.278 elapsed) :ghc>>

GHC 8.2.1:

<<ghc: 115210990008 bytes, 6383 GCs, 116487828/234031864 avg/max bytes
residency (77 samples), 670M in use, 0.001 INIT (0.000 elapsed),
64.154 MUT (68.262 elapsed), 37.114 GC (37.077 elapsed) :ghc>>

Reproducing

$ cabal unpack regex-tdfa-1.2.2
$ cd regex-tdfa-1.2.2
$ cabal install --only-dependencies
$ cabal configure
$ cabal build
$ time ghc -idist/build/autogen -O2 Text/Regex/TDFA.hs \
   -XMagicHash -XFlexibleInstances -XMultiParamTypeClasses \
   -XRecursiveDo -XBangPatterns -XRankNTypes -XUnboxedTuples \
   -XFlexibleContexts -XUnliftedFFITypes
Trac metadata
Trac field Value
Version 8.0.1
Type Task
TypeOfFailure OtherFailure
Priority high
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information