Skip to content

Type-checking performance regression

Attached is a module Def1, which defines a load of type synonyms and some values, and a module !ReExport1, which just re-exports Def1.

  1. 10 is comparable to 6.8 when compiling Def1, but rather than taking a couple of seconds to compile !ReExport1 it takes about 3 minutes.

Def2/ReExport2 are the same, but only contain the type synonyms. The difference in this case is 1 second vs 30 seconds.

GHC 6.8.2:

$ rm *.o; rm *.hi
$ time $GHC -O -fforce-recomp -c Def1.hs
$GHC -O -fforce-recomp -c Def1.hs  36.00s user 0.82s system 100% cpu 36.717 total
$ time $GHC -O -fforce-recomp -c ReExport1.hs
$GHC -O -fforce-recomp -c ReExport1.hs  2.22s user 0.11s system 100% cpu 2.332 total
$ time $GHC -O -fforce-recomp -c Def2.hs
$GHC -O -fforce-recomp -c Def2.hs  7.20s user 0.14s system 99% cpu 7.340 total
$ time $GHC -O -fforce-recomp -c ReExport2.hs
$GHC -O -fforce-recomp -c ReExport2.hs  0.99s user 0.08s system 100% cpu 1.075 total
$ $GHC --version
The Glorious Glasgow Haskell Compilation System, version 6.8.2
  1. 10 branch:
$ rm *.o; rm *.hi
$ time $GHC -O -fforce-recomp -c Def1.hs
$GHC -O -fforce-recomp -c Def1.hs  35.94s user 0.60s system 100% cpu 36.350 total
$ time $GHC -O -fforce-recomp -c ReExport1.hs
$GHC -O -fforce-recomp -c ReExport1.hs  169.35s user 0.28s system 99% cpu 2:49.67 total
$ time $GHC -O -fforce-recomp -c Def2.hs
$GHC -O -fforce-recomp -c Def2.hs  8.37s user 0.11s system 100% cpu 8.477 total
$ time $GHC -O -fforce-recomp -c ReExport2.hs
$GHC -O -fforce-recomp -c ReExport2.hs  29.11s user 0.10s system 99% cpu 29.258 total
$ $GHC --version                                
The Glorious Glasgow Haskell Compilation System, version 6.10.0.20081009
Trac metadata
Trac field Value
Version 6.8.3
Type Bug
TypeOfFailure OtherFailure
Priority high
Resolution Unresolved
Component Compiler (Type checker)
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