31
31
├─ <example>
32
32
│ ├── results.csv - aggregated results for all the versions
33
33
│ └── <git-reference>
34
- │ ├── <experiment>.benchmark- gcStats - RTS -s output
34
+ │ ├── <experiment>.gcStats.log - RTS -s output
35
35
│ ├── <experiment>.csv - stats for the experiment
36
36
│ ├── <experiment>.svg - Graph of bytes over elapsed time
37
37
│ ├── <experiment>.diff.svg - idem, including the previous version
38
+ │ ├── <experiment>.heap.svg - Heap profile
38
39
│ ├── <experiment>.log - bench stdout
39
40
│ └── results.csv - results of all the experiments for the example
40
41
├── results.csv - aggregated results of all the experiments and versions
@@ -224,9 +225,9 @@ benchRules build benchResource MkBenchRules{..} = do
224
225
-- run an experiment
225
226
priority 0 $
226
227
[ build -/- " */*/*.csv" ,
227
- build -/- " */*/*.benchmark- gcStats" ,
228
+ build -/- " */*/*.gcStats.log " ,
228
229
build -/- " */*/*.hp" ,
229
- build -/- " */*/*.log"
230
+ build -/- " */*/*.output. log"
230
231
]
231
232
&%> \ [outcsv, outGc, outHp, outLog] -> do
232
233
let [_, exampleName, ver, exp ] = splitDirectories outcsv
@@ -236,7 +237,7 @@ benchRules build benchResource MkBenchRules{..} = do
236
237
setupRes <- setupProject
237
238
liftIO $ createDirectoryIfMissing True $ dropFileName outcsv
238
239
let exePath = build </> " binaries" </> ver </> executableName
239
- exeExtraArgs = [" +RTS" , " -h" , " -S" <> outGc, " -RTS" ]
240
+ exeExtraArgs = [" +RTS" , " -h" , " -i1 " , " -qg " , " - S" <> outGc, " -RTS" ]
240
241
ghcPath = build </> " binaries" </> ver </> " ghc.path"
241
242
experiment = Escaped $ dropExtension exp
242
243
need [exePath, ghcPath]
@@ -250,22 +251,16 @@ benchRules build benchResource MkBenchRules{..} = do
250
251
AddPath [takeDirectory ghcPath, " ." ] []
251
252
]
252
253
BenchProject {.. }
253
- liftIO $ renameFile " ghcide.hp" $ dropFileName outcsv </> dropExtension exp <.> " hp "
254
+ liftIO $ renameFile " ghcide.hp" outHp
254
255
255
256
-- extend csv output with allocation data
256
257
csvContents <- liftIO $ lines <$> readFile outcsv
257
258
let header = head csvContents
258
259
results = tail csvContents
259
260
header' = header <> " , maxResidency, allocatedBytes"
260
261
results' <- forM results $ \ row -> do
261
- -- assume that the gcStats file can be guessed from the row id
262
- -- assume that the row id is the first column
263
- let id = takeWhile (/= ' ,' ) row
264
- let gcStatsPath = dropFileName outcsv </> escapeSpaces id <.> " benchmark-gcStats"
265
- (maxResidency, allocations) <- liftIO $
266
- ifM (IO. doesFileExist gcStatsPath)
267
- (parseMaxResidencyAndAllocations <$> readFile gcStatsPath)
268
- (pure (0 ,0 ))
262
+ (maxResidency, allocations) <- liftIO
263
+ (parseMaxResidencyAndAllocations <$> readFile outGc)
269
264
return $ printf " %s, %s, %s" row (showMB maxResidency) (showMB allocations)
270
265
let csvContents' = header' : results'
271
266
writeFileLines outcsv csvContents'
@@ -495,8 +490,8 @@ data RunLog = RunLog
495
490
496
491
loadRunLog :: HasCallStack => FilePath -> String -> Escaped FilePath -> FilePath -> Action RunLog
497
492
loadRunLog buildF example exp ver = do
498
- let log_fp = buildF </> example </> ver </> escaped exp <.> " benchmark-gcStats "
499
- csv_fp = replaceExtension log_fp " csv "
493
+ let csv_fp = buildF </> example </> ver </> escaped exp <.> " csv "
494
+ log_fp = replaceExtension csv_fp " gcStats.log "
500
495
log <- readFileLines log_fp
501
496
csv <- readFileLines csv_fp
502
497
let frames =
0 commit comments