ghci -fobject-code -O2 doesn't do the same optimisations as ghc --make -O2
From IRC:
I have a module that takes around 10 seconds to compile on ghc --make -O2, but only around 3 seconds on ghci -fobject-code -O2.
bgamari: that is surprising
I've put the -v timing output of the two cases into https://gist.github.com/nh2/e9bc4732111bfe422d8e606c10f8f0ac
I'm comparing the 2 files with meld
for spotting differences easily.
Check e.g. Result size of Tidy Core
which seems to have 3x as many terms for ghc, and Simplifier [Mymodule]
doesn't seem to run in ghci
The first time terms are different is at Desugar, the first time a factor 3 comes in is after
Specialize`.
bgamari: wow, it sounds like the simplifier isn't getting run as aggressively in GHCi
I'm running this on Ubuntu 16.04 inside nix (but happens the same way outside nix).
Trac metadata
Trac field | Value |
---|---|
Version | 8.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | nh2 |
Operating system | |
Architecture |