[GHC] #15938: Hadrian's recompilation check is extremely slow
GHC
ghc-devs at haskell.org
Fri Nov 30 11:23:32 UTC 2018
#15938: Hadrian's recompilation check is extremely slow
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: bug | Status: new
Priority: high | Milestone: 8.8.1
Component: Build System | Version: 8.6.2
(Hadrian) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by snowleopard):
I think I know a way to reduce the number of file pattern matchings in
Hadrian.
Currently we generate build rules for each build context and there are
hundreds of contexts, e.g. see generation of
`Rules.Compile.compilePackage`:
https://github.com/ghc/ghc/blob/master/hadrian/src/Rules.hs#L108
Instead, we should generate just one build rule per logical target and
parse various context parameters from the path, as implemented in
`libraryRules`:
https://github.com/ghc/ghc/blob/master/hadrian/src/Rules/Library.hs#L22
We need to rewrite all build rules in the same manner. This will
essentially replace hundred-long linear chains of file pattern matchings
with a single matching and subsequent parsing.
This is an obvious optimisation, but requires a good understanding of
Hadrian internals. I am happy to volunteer to implement this, but I'm
unlikely to find time until the end of teaching term in the university
(end of December). If anyone has a chance to do this earlier, please go
ahead, I can review a patch.
P.S.: I still have no idea where the long pauses after `Ctrl-C`-ing come
from.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15938#comment:24>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list