[Git][ghc/ghc][wip/romes/rts-linker-direct-symbol-lookup] 7 commits: Detected lists with lot of redundant modules; considered invasive change

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Tue Mar 26 17:32:55 UTC 2024



Rodrigo Mesquita pushed to branch wip/romes/rts-linker-direct-symbol-lookup at Glasgow Haskell Compiler / GHC


Commits:
fb9b266c by Rodrigo Mesquita at 2024-03-26T13:22:51+00:00
Detected lists with lot of redundant modules; considered invasive change

- - - - -
34ef656d by Rodrigo Mesquita at 2024-03-26T13:23:30+00:00
Revert "Detected lists with lot of redundant modules; considered invasive change"

This reverts commit fb9b266c4973eb98d837eff723438d799ee7beaf.

- - - - -
ef3a3c4c by Rodrigo Mesquita at 2024-03-26T16:32:35+00:00
VERY GOOD -3.5 seconds, instant main

- - - - -
73b5ba3f by Rodrigo Mesquita at 2024-03-26T16:34:26+00:00
another potential perf improv

- - - - -
8cc84e82 by Rodrigo Mesquita at 2024-03-26T16:34:26+00:00
DEBUG LINES TO DROP

- - - - -
703e0b3a by Rodrigo Mesquita at 2024-03-26T16:34:26+00:00
Revert "DEBUG LINES TO DROP"

This reverts commit dab08260e62eccec5697954133504a4865431ee0.

- - - - -
f6f6541b by Rodrigo Mesquita at 2024-03-26T17:32:43+00:00
Minus 1second wall time???

- - - - -


3 changed files:

- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Types.hs


Changes:

=====================================
compiler/GHC/ByteCode/Types.hs
=====================================
@@ -1,3 +1,4 @@
+{-# LANGUAGE StrictData #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE RecordWildCards            #-}
 {-# LANGUAGE TypeApplications           #-}


=====================================
compiler/GHC/Linker/Loader.hs
=====================================
@@ -74,6 +74,7 @@ import GHC.Utils.Outputable
 import GHC.Utils.Panic
 import GHC.Utils.Error
 import GHC.Utils.Logger
+import GHC.Utils.Misc
 import GHC.Utils.TmpFs
 
 import GHC.Unit.Env
@@ -222,8 +223,8 @@ loadDependencies
   -> SrcSpan
   -> [Module]
   -> IO (LoaderState, SuccessFlag, [Linkable], PkgsLoaded) -- ^ returns the set of linkables required
+-- When called, the loader state must have been initialized (see `initLoaderState`)
 loadDependencies interp hsc_env pls span needed_mods = do
---   initLoaderState (hsc_dflags hsc_env) dl
    let opts = initLinkDepsOpts hsc_env
 
    -- Find what packages and linkables are required
@@ -622,6 +623,7 @@ loadExpr interp hsc_env span root_ul_bco = do
   where
      free_names = uniqDSetToList (bcoFreeNames root_ul_bco)
 
+     -- ROMES:TODO: Consider deduplicating, can have lots of duplicates.
      needed_mods :: [Module]
      needed_mods = [ nameModule n | n <- free_names,
                      isExternalName n,      -- Names from other modules
@@ -932,6 +934,7 @@ linkSomeBCOs interp pkgs_loaded le mods = foldr fun do_link mods []
     let flat = [ bco | bcos <- mods, bco <- bcos ]
         names = map unlinkedBCOName flat
         bco_ix = mkNameEnv (zip names [0..])
+    -- ROMES:TODO: Can we do this linkBCO sequence concurrently?!
     resolved <- sequence [ linkBCO interp pkgs_loaded le bco_ix bco | bco <- flat ]
     hvrefs <- createBCOs interp resolved
     return (zip names hvrefs)


=====================================
compiler/GHC/Linker/Types.hs
=====================================
@@ -1,3 +1,4 @@
+{-# LANGUAGE StrictData #-}
 -----------------------------------------------------------------------------
 --
 -- Types for the linkers and the loader



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ba972f7d77b75941b19d44ad7c505c28d14dc8ac...f6f6541be3c57867f2b9d9c5e5dd5a5677ec476e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ba972f7d77b75941b19d44ad7c505c28d14dc8ac...f6f6541be3c57867f2b9d9c5e5dd5a5677ec476e
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240326/610b89b9/attachment-0001.html>


More information about the ghc-commits mailing list