mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
Disable scenario service during packaging (#6543)
For `damlc test` and `damlc ide`, `optScenarioService` is (correctly) enabled. However, every call to `withDamlIdeState` will spawn a scenario service. This means that during package initialization we will spawn at least one extra scenario service (potentially) more. On a simple project this gets `damlc test` from 10s down to 7s and I see a noticeable (although hard to measure) speedup in IDE startup time. changelog_begin changelog_end
This commit is contained in:
parent
470d4f28a5
commit
6213f560ef
@ -70,7 +70,7 @@ import SdkVersion
|
||||
-- and then remap references to those dummy packages to the original DAML-LF
|
||||
-- package id.
|
||||
createProjectPackageDb :: NormalizedFilePath -> Options -> PackageSdkVersion -> MS.Map UnitId GHC.ModuleName -> [FilePath] -> [FilePath] -> IO ()
|
||||
createProjectPackageDb projectRoot opts thisSdkVer modulePrefixes deps dataDeps
|
||||
createProjectPackageDb projectRoot (disableScenarioService -> opts) thisSdkVer modulePrefixes deps dataDeps
|
||||
| null dataDeps && all (`elem` basePackages) deps =
|
||||
-- Initializing the package db is expensive since it requires calling GenerateStablePackages and GeneratePackageMap.
|
||||
--Therefore we only do it if we actually have a dependency.
|
||||
@ -194,6 +194,11 @@ createProjectPackageDb projectRoot opts thisSdkVer modulePrefixes deps dataDeps
|
||||
removePathForcibly dbPath
|
||||
createDirectoryIfMissing True $ dbPath </> "package.conf.d"
|
||||
|
||||
disableScenarioService :: Options -> Options
|
||||
disableScenarioService opts = opts
|
||||
{ optScenarioService = EnableScenarioService False
|
||||
}
|
||||
|
||||
toGhcModuleName :: LF.ModuleName -> GHC.ModuleName
|
||||
toGhcModuleName = GHC.mkModuleName . T.unpack . LF.moduleNameString
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user