[GHC] #8731: long compilation time for module with large data type and partial record selectors
GHC
ghc-devs at haskell.org
Mon Feb 3 23:44:34 UTC 2014
#8731: long compilation time for module with large data type and partial record
selectors
-------------------------+-------------------------------------------------
Reporter: | Owner:
carter | Status: new
Type: bug | Milestone:
Priority: | Version: 7.8.1-rc1
normal | Operating System: Unknown/Multiple
Component: | Type of failure: Compile-time performance bug
Compiler | Test Case:
Keywords: | Blocking:
Architecture: |
Unknown/Multiple |
Difficulty: |
Unknown |
Blocked By: |
Related Tickets: |
-------------------------+-------------------------------------------------
in both ghc 7.6 and 7.8rc, the Constants module in LLVM-General-Pure (and
a few other similar modules) have surprisingly long (and noticable!)
compilation times.
This seems to related to how GHC handles a many constructor data type with
overlapping field names.
the time is nearly the same for building a static module with O1 and O2
{{{
carter repoScratcher/bad-ast » time ghc Constant.hs -O2
1 ↵
[1 of 1] Compiling Constant ( Constant.hs, Constant.o )
ghc Constant.hs -O2 7.52s user 0.23s system 99% cpu 7.755 total
}}}
{{{
carter repoScratcher/bad-ast » time ghc Constant.hs -O1
[1 of 1] Compiling Constant ( Constant.hs, Constant.o )
ghc Constant.hs -O1 6.62s user 0.20s system 100% cpu 6.768 total
}}}
heck even with -O0 its slow (though not terrible)
{{{
carter repoScratcher/bad-ast » time ghc Constant.hs -O0
[1 of 1] Compiling Constant ( Constant.hs, Constant.o )
ghc Constant.hs -O0 2.76s user 0.14s system 101% cpu 2.873 total
}}}
Seems like there might something wrong in how we handle data types like
this, the complexity need not
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8731>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list