diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-08-09 11:29:45 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-08-13 07:54:32 -0400 |
commit | c367b39e5236b86b4923d826ab0395b33211d30a (patch) | |
tree | 658e595a18356bcda04f3f72b168eb86bc51bf99 /compiler/GHC/Driver/Pipeline.hs | |
parent | 7ad813a480c9ed383fe1fea11a57f90d4f6f9b71 (diff) | |
download | haskell-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 'compiler/GHC/Driver/Pipeline.hs')
-rw-r--r-- | compiler/GHC/Driver/Pipeline.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs index b282304a1a..cd8205f6ad 100644 --- a/compiler/GHC/Driver/Pipeline.hs +++ b/compiler/GHC/Driver/Pipeline.hs @@ -62,6 +62,7 @@ import GHC.Driver.Errors.Types import GHC.Driver.Pipeline.Monad import GHC.Driver.Config.Diagnostic import GHC.Driver.Phases +import GHC.Driver.Pipeline.Execute import GHC.Driver.Pipeline.Phases import GHC.Driver.Session import GHC.Driver.Backend @@ -118,9 +119,9 @@ import Control.Monad import qualified Control.Monad.Catch as MC (handle) import Data.Maybe import Data.Either ( partitionEithers ) +import qualified Data.Set as Set import Data.Time ( getCurrentTime ) -import GHC.Driver.Pipeline.Execute -- Simpler type synonym for actions in the pipeline monad type P m = TPipelineClass TPhase m @@ -412,7 +413,10 @@ link' logger tmpfs dflags unit_env batch_attempt_linking hpt home_mod_infos = eltsHpt hpt -- the packages we depend on - pkg_deps = concatMap (dep_direct_pkgs . mi_deps . hm_iface) home_mod_infos + pkg_deps = Set.toList + $ Set.unions + $ fmap (dep_direct_pkgs . mi_deps . hm_iface) + $ home_mod_infos -- the linkables to link linkables = map (expectJust "link".hm_linkable) home_mod_infos |