Skip to content

Commit

Permalink
performMinorGC before collecting end RTSStats
Browse files Browse the repository at this point in the history
RTSStats are updated on GC, so this ensures that the collected memory
stats are accurate.
  • Loading branch information
meooow25 authored and Bodigrim committed Nov 26, 2024
1 parent 2786e99 commit 9c04b98
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Test/Tasty/Bench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@ measure timeMode n (Benchmarkable act) = do
(startAllocs, startCopied, startMaxMemInUse) <- getAllocsAndCopied
act n
endTime <- getTimePicoSecs'
performMinorGC -- perform GC to update RTSStats
(endAllocs, endCopied, endMaxMemInUse) <- getAllocsAndCopied
let meas = Measurement
{ measTime = endTime - startTime
Expand Down

0 comments on commit 9c04b98

Please sign in to comment.