Separate primary and extra countdown benchmarks

This commit is contained in:
Andrzej Rybczak 2023-07-31 14:58:13 +02:00
parent 46ae928e71
commit 810c64358f

View File

@ -20,9 +20,30 @@ main = defaultMain
[ concurrencyBenchmark
, unliftBenchmark
, bgroup "countdown" $ map countdown [1000, 2000, 3000]
, bgroup "countdown (extra)" $ map countdownExtra [1000, 2000, 3000]
, bgroup "filesize" $ map filesize [1000, 2000, 3000]
]
countdownExtra :: Integer -> Benchmark
countdownExtra n = bgroup (show n)
[ bgroup "effectful (local/static/state)"
[ bench "shallow" $ nf countdownEffectfulLocalSt n
, bench "deep" $ nf countdownEffectfulLocalDeepSt n
]
, bgroup "effectful (local/static/stateM)"
[ bench "shallow" $ nf countdownEffectfulLocalStM n
, bench "deep" $ nf countdownEffectfulLocalDeepStM n
]
, bgroup "effectful (local/dynamic/double)"
[ bench "shallow" $ nf countdownEffectfulDoubleDynLocal n
, bench "deep" $ nf countdownEffectfulDoubleDynLocalDeep n
]
, bgroup "effectful (shared/dynamic/double)"
[ bench "shallow" $ nf countdownEffectfulDoubleDynShared n
, bench "deep" $ nf countdownEffectfulDoubleDynSharedDeep n
]
]
countdown :: Integer -> Benchmark
countdown n = bgroup (show n)
[ bench "reference (pure)" $ nf countdownRef n
@ -31,22 +52,10 @@ countdown n = bgroup (show n)
[ bench "shallow" $ nf countdownEffectfulLocal n
, bench "deep" $ nf countdownEffectfulLocalDeep n
]
, bgroup "effectful (local/static/state)"
[ bench "shallow" $ nf countdownEffectfulLocalSt n
, bench "deep" $ nf countdownEffectfulLocalDeepSt n
]
, bgroup "effectful (local/static/stateM)"
[ bench "shallow" $ nf countdownEffectfulLocalStM n
, bench "deep" $ nf countdownEffectfulLocalDeepStM n
]
, bgroup "effectful (local/dynamic)"
[ bench "shallow" $ nf countdownEffectfulDynLocal n
, bench "deep" $ nf countdownEffectfulDynLocalDeep n
]
, bgroup "effectful (local/dynamic/double)"
[ bench "shallow" $ nf countdownEffectfulDoubleDynLocal n
, bench "deep" $ nf countdownEffectfulDoubleDynLocalDeep n
]
, bgroup "effectful (shared/static)"
[ bench "shallow" $ nf countdownEffectfulShared n
, bench "deep" $ nf countdownEffectfulSharedDeep n
@ -55,10 +64,6 @@ countdown n = bgroup (show n)
[ bench "shallow" $ nf countdownEffectfulDynShared n
, bench "deep" $ nf countdownEffectfulDynSharedDeep n
]
, bgroup "effectful (shared/dynamic/double)"
[ bench "shallow" $ nf countdownEffectfulDoubleDynShared n
, bench "deep" $ nf countdownEffectfulDoubleDynSharedDeep n
]
#ifdef VERSION_cleff
, bgroup "cleff (local)"
[ bench "shallow" $ nf countdownCleffLocal n