diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-06-08 20:49:49 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-06-08 20:49:49 +0100 |
commit | b95ccfb24d5b51a68ee173e04564e98d6a8f6180 (patch) | |
tree | ec1ccfcddfe2f98c37dac3bbc6b4ab30b2b44d8f /compiler/GHC/Unit/Finder | |
parent | 9e724f6e5bcb31abd270ea44fb01b1edb18f626f (diff) | |
download | haskell-wip/hash-file-cache.tar.gz |
FinderCache: Also cache file hashing in interface file checkswip/hash-file-cache
Now that we hash object files to decide when to recompile due to TH,
this can make a big difference as each interface file in a project will
contain reference to the object files of all package dependencies.
Especially when these are statically linked, hashing them can add up.
The cache is invalidated when `depanalPartial` is called, like the
normal finder cache.
Diffstat (limited to 'compiler/GHC/Unit/Finder')
-rw-r--r-- | compiler/GHC/Unit/Finder/Types.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/GHC/Unit/Finder/Types.hs b/compiler/GHC/Unit/Finder/Types.hs index 06f4ea8aae..c48b7d9789 100644 --- a/compiler/GHC/Unit/Finder/Types.hs +++ b/compiler/GHC/Unit/Finder/Types.hs @@ -9,6 +9,8 @@ where import GHC.Prelude import GHC.Unit import GHC.Unit.State +import qualified Data.Map as M +import GHC.Fingerprint import Data.IORef @@ -18,7 +20,10 @@ import Data.IORef -- contents of this cache. -- type FinderCacheState = InstalledModuleEnv InstalledFindResult -newtype FinderCache = FinderCache (IORef FinderCacheState) +type FileCacheState = M.Map FilePath Fingerprint +data FinderCache = FinderCache { fcModuleCache :: (IORef FinderCacheState) + , fcFileCache :: (IORef FileCacheState) + } data InstalledFindResult = InstalledFound ModLocation InstalledModule |