Commit e3cbe319 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

Packages: Add timing for package database initialization

parent 4664bafc
Pipeline #9095 canceled with stages
......@@ -84,7 +84,8 @@ import CmdLineParser
import System.Environment ( getEnv )
import FastString
import ErrUtils ( debugTraceMsg, MsgDoc, dumpIfSet_dyn, compilationProgressMsg )
import ErrUtils ( debugTraceMsg, MsgDoc, dumpIfSet_dyn, compilationProgressMsg,
withTiming )
import Exception
import System.Directory
......@@ -468,7 +469,9 @@ listPackageConfigMap dflags = eltsUDFM pkg_map
-- 'pkgState' in 'DynFlags' and return a list of packages to
-- link in.
initPackages :: DynFlags -> IO (DynFlags, [PreloadUnitId])
initPackages dflags0 = do
initPackages dflags0 = withTiming (return dflags0)
(text "initializing package database")
forcePkgDb $ do
dflags <- interpretPackageEnv dflags0
pkg_db <-
case pkgDatabase dflags of
......@@ -481,6 +484,8 @@ initPackages dflags0 = do
pkgState = pkg_state,
thisUnitIdInsts_ = insts },
preload)
where
forcePkgDb (dflags, _) = pkgIdMap (pkgState dflags) `seq` ()
-- -----------------------------------------------------------------------------
-- Reading the package database(s)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment