Skip to content

Commit 5002b36

Browse files
committed
Parallelize benchmarks
1 parent 759901f commit 5002b36

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ghcide/bench/hist/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ type instance RuleResult GetExample = Maybe Example
6666
type instance RuleResult GetExamples = [Example]
6767

6868
main :: IO ()
69-
main = shakeArgs shakeOptions {shakeChange = ChangeModtimeAndDigest} $ do
69+
main = shakeArgs shakeOptions {shakeChange = ChangeModtimeAndDigest, shakeThreads = 0} $ do
7070
createBuildSystem $ \resource -> do
7171
configStatic <- liftIO $ readConfigIO config
7272
let build = outputFolder configStatic

shake-bench/src/Development/Benchmark/Rules.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,14 @@ buildRules build MkBuildRules{..} = do
188188
[build -/- "binaries/*/" <> executableName
189189
,build -/- "binaries/*/ghc.path"
190190
] &%> \[out, ghcPath] -> do
191-
let [_, _binaries, _ver, _] = splitDirectories out
191+
let [_, _binaries, ver, _] = splitDirectories out
192192
liftIO $ createDirectoryIfMissing True $ dropFileName out
193193
commitid <- readFile' $ takeDirectory out </> "commitid"
194-
cmd_ $ "git worktree add bench-temp " ++ commitid
194+
cmd_ $ "git worktree add bench-temp-" ++ ver ++ " " ++ commitid
195195
buildSystem <- askOracle $ GetBuildSystem ()
196-
flip actionFinally (cmd_ ("git worktree remove bench-temp --force" :: String)) $ do
197-
ghcLoc <- liftIO $ findGhc buildSystem "bench-temp"
198-
buildProject buildSystem [Cwd "bench-temp"] (".." </> takeDirectory out)
196+
flip actionFinally (cmd_ ("git worktree remove bench-temp-" <> ver <> " --force" :: String)) $ do
197+
ghcLoc <- liftIO $ findGhc buildSystem ver
198+
buildProject buildSystem [Cwd $ "bench-temp-" <> ver] (".." </> takeDirectory out)
199199
writeFile' ghcPath ghcLoc
200200

201201
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)