Make module membership on ModuleGraph faster
authorBartosz Nitka <niteria@gmail.com>
Tue, 27 Jun 2017 16:55:17 +0000 (12:55 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 27 Jun 2017 17:34:05 +0000 (13:34 -0400)
commitb0708588e87554899c2efc80a2d3eba353dbe926
tree03817b07a5c542a45d6058cf19a09efeaf5037bc
parent6567c815135e93f8550d526f81d13f31c0cd92b6
Make module membership on ModuleGraph faster

When loading/reloading with a large number of modules
(>5000) the cost of linear lookups becomes significant.

The changes here made `:reload` go from 6s to 1s on my
test case.

The bottlenecks were `needsLinker` in `DriverPipeline` and
`getModLoop` in `GhcMake`.

Test Plan: ./validate

Reviewers: simonmar, austin, bgamari

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3646
13 files changed:
compiler/backpack/DriverBkp.hs
compiler/main/DriverMkDepend.hs
compiler/main/DriverPipeline.hs
compiler/main/GHC.hs
compiler/main/GhcMake.hs
compiler/main/HscMain.hs
compiler/main/HscTypes.hs
ghc/GHCi/UI.hs
ghc/GHCi/UI/Tags.hs
testsuite/tests/ghc-api/apirecomp001/myghc.hs
utils/check-api-annotations/Main.hs
utils/check-ppr/Main.hs
utils/ghctags/Main.hs