Make module membership on ModuleGraph faster
authorBartosz Nitka <niteria@gmail.com>
Wed, 31 May 2017 17:47:03 +0000 (10:47 -0700)
committerBartosz Nitka <niteria@gmail.com>
Tue, 18 Jul 2017 12:27:01 +0000 (05:27 -0700)
commitb8fec6950ad99cbf11cd22698b8d5ab35afb828f
treeda026b84ac5cfbf34c910d526fda9e106298cccb
parent935acb6f0de36822b46f8444199dbc37de784af4
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: thomie, rwbarton

Differential Revision: https://phabricator.haskell.org/D3703
14 files changed:
compiler/backpack/DriverBkp.hs
compiler/basicTypes/Module.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