Skip to content

Commit 10dbde0

Browse files
authored
Interleave and pretty print benchmark results (#866)
* Interleave benchmark results * Pretty print benchmark results
1 parent 7339784 commit 10dbde0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.azure/linux-bench.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
stack bench --ghc-options=-Werror --stack-yaml=$STACK_YAML || stack bench --ghc-options=-Werror --stack-yaml=$STACK_YAML || stack bench --ghc-options=-Werror --stack-yaml=$STACK_YAML
4343
displayName: 'stack bench --ghc-options=-Werror'
4444
- bash: |
45-
cat bench-results/results.csv
45+
column -s, -t < bench-results/results.csv
4646
displayName: "cat results"
4747
- publish: bench-results
4848
artifact: benchmarks

bench/hist/Main.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import System.FilePath
6565
import qualified Text.ParserCombinators.ReadP as P
6666
import Text.Read (Read (..), get, readMaybe, readP_to_Prec)
6767
import GHC.Stack (HasCallStack)
68+
import Data.List (transpose)
6869

6970
config :: FilePath
7071
config = "bench/config.yaml"
@@ -238,7 +239,7 @@ main = shakeArgs shakeOptions {shakeChange = ChangeModtimeAndDigest} $ do
238239
header' = "version, " <> header
239240
results' = zipWith (\v -> map (\l -> v <> ", " <> l)) versions results
240241

241-
writeFileChanged out $ unlines $ header' : concat results'
242+
writeFileChanged out $ unlines $ header' : interleave results'
242243

243244
priority 2 $
244245
build -/- "*/*/*.diff.svg" %> \out -> do
@@ -482,6 +483,9 @@ unescapeExperiment = Unescaped . map f . escaped
482483
f '_' = ' '
483484
f other = other
484485

486+
interleave :: [[a]] -> [a]
487+
interleave = concat . transpose
488+
485489
myColors :: [E.AlphaColour Double]
486490
myColors = map E.opaque
487491
[ E.blue

0 commit comments

Comments
 (0)