Skip to content

Commit

Permalink
render durations up to milliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Aug 21, 2022
1 parent 8361255 commit bc907e9
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions ghcide/bench/lib/Experiments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import System.FilePath ((<.>), (</>))
import System.Process
import System.Time.Extra
import Text.ParserCombinators.ReadP (readP_to_S)
import Text.Printf
charEdit :: Position -> TextDocumentContentChangeEvent
charEdit p =
TextDocumentContentChangeEvent
Expand Down Expand Up @@ -365,15 +366,15 @@ runBenchmarksFun dir allBenchmarks = do
[ [ name,
show success,
show samples,
show startup,
show runSetup',
show userWaits,
show delayedWork,
show $ firstResponse+firstResponseDelayed,
showMs startup,
showMs runSetup',
showMs userWaits,
showMs delayedWork,
showMs $ firstResponse+firstResponseDelayed,
-- Exclude first response as it has a lot of setup time included
-- Assume that number of requests = number of modules * number of samples
show ((userWaits - firstResponse)/((fromIntegral samples - 1)*modules)),
show runExperiment,
showMs ((userWaits - firstResponse)/((fromIntegral samples - 1)*modules)),
showMs runExperiment,
show rulesBuilt,
show rulesChanged,
show rulesVisited,
Expand Down Expand Up @@ -439,6 +440,9 @@ runBenchmarksFun dir allBenchmarks = do
lspTestCaps =
fullCaps {_window = Just $ WindowClientCapabilities (Just True) Nothing Nothing }

showMs :: Seconds -> String
showMs = printf "%.2f"

data BenchRun = BenchRun
{ startup :: !Seconds,
runSetup :: !Seconds,
Expand Down

0 comments on commit bc907e9

Please sign in to comment.