diff options
author | Bartosz Nitka <niteria@gmail.com> | 2017-05-31 10:47:03 -0700 |
---|---|---|
committer | Bartosz Nitka <niteria@gmail.com> | 2017-06-14 15:12:16 -0700 |
commit | 9f86f367b4eba8cb594a6fcc572ffbd7ac30467d (patch) | |
tree | dd09fbb576694396ec6051a899e34b258dbe012d /utils/check-api-annotations | |
parent | 430137c45420153dafbd448b4d509f893fe675f4 (diff) | |
download | haskell-wip/D3646.tar.gz |
Make module membership on ModuleGraph fasterwip/D3646
Summary:
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
Diffstat (limited to 'utils/check-api-annotations')
-rw-r--r-- | utils/check-api-annotations/Main.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/utils/check-api-annotations/Main.hs b/utils/check-api-annotations/Main.hs index 1d577421fb..6b973e12e8 100644 --- a/utils/check-api-annotations/Main.hs +++ b/utils/check-api-annotations/Main.hs @@ -32,11 +32,11 @@ testOneFile libdir fileName = do , targetContents = Nothing } _ <- load LoadAllTargets graph <- getModuleGraph - let - modSum = case filter modByFile graph of - [x] -> x - xs -> error $ "Can't find module, got:" - ++ show (map (ml_hs_file . ms_location) xs) + let modSum = + case filter modByFile (mgModSummaries graph) of + [x] -> x + xs -> error $ "Can't find module, got:" + ++ show (map (ml_hs_file . ms_location) xs) p <- parseModule modSum return (pm_annotations p,p) |