summaryrefslogtreecommitdiff
path: root/compiler/main/HscMain.hs
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2017-05-31 10:47:03 -0700
committerBartosz Nitka <niteria@gmail.com>2017-07-18 05:27:01 -0700
commitb8fec6950ad99cbf11cd22698b8d5ab35afb828f (patch)
treeda026b84ac5cfbf34c910d526fda9e106298cccb /compiler/main/HscMain.hs
parent935acb6f0de36822b46f8444199dbc37de784af4 (diff)
downloadhaskell-b8fec6950ad99cbf11cd22698b8d5ab35afb828f.tar.gz
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
Diffstat (limited to 'compiler/main/HscMain.hs')
-rw-r--r--compiler/main/HscMain.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index 196e309caa..c514e5b017 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -184,7 +184,7 @@ newHscEnv dflags = do
iserv_mvar <- newMVar Nothing
return HscEnv { hsc_dflags = dflags
, hsc_targets = []
- , hsc_mod_graph = []
+ , hsc_mod_graph = emptyMG
, hsc_IC = emptyInteractiveContext dflags
, hsc_HPT = emptyHomePackageTable
, hsc_EPS = eps_var