summaryrefslogtreecommitdiff
path: root/utils/count-deps
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-08-09 11:29:45 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-13 07:54:32 -0400
commitc367b39e5236b86b4923d826ab0395b33211d30a (patch)
tree658e595a18356bcda04f3f72b168eb86bc51bf99 /utils/count-deps
parent7ad813a480c9ed383fe1fea11a57f90d4f6f9b71 (diff)
downloadhaskell-c367b39e5236b86b4923d826ab0395b33211d30a.tar.gz
Refactoring module dependencies
* Make mkDependencies pure * Use Sets instead of sorted lists Notable perf changes: MultiLayerModules(normal) ghc/alloc 4130851520.0 2981473072.0 -27.8% T13719(normal) ghc/alloc 4313296052.0 4151647512.0 -3.7% Metric Decrease: MultiLayerModules T13719
Diffstat (limited to 'utils/count-deps')
-rw-r--r--utils/count-deps/Main.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/count-deps/Main.hs b/utils/count-deps/Main.hs
index 2ce6ea9f5b..fc37ac555b 100644
--- a/utils/count-deps/Main.hs
+++ b/utils/count-deps/Main.hs
@@ -13,6 +13,7 @@ import Control.Monad.IO.Class
import System.Environment
import GHC.Unit.Module.Deps
import Data.Map.Strict qualified as Map
+import Data.Set qualified as Set
-- Example invocation:
-- inplace/bin/count-deps `inplace/bin/ghc-stage2 --print-libdir` "GHC.Parser"
@@ -77,4 +78,4 @@ calcDeps modName libdir =
mkModule = Module (stringToUnit "ghc")
modDeps :: ModIface -> [ModuleName]
- modDeps mi = map gwib_mod $ dep_direct_mods (mi_deps mi)
+ modDeps mi = map gwib_mod $ Set.toList $ dep_direct_mods (mi_deps mi)