Skip to content

Commit d0d2f7a

Browse files
authored
Merge pull request #451 from IntersectMBO/wenkokke/warn-benchmark-debug
Clarify warning when benchmarking in debug mode
2 parents 31983c6 + 8bb616c commit d0d2f7a

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

bench/macro/lsm-tree-bench-bloomfilter.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ benchmarkNumBitsPerEntry = 10
6666
benchmarks :: IO ()
6767
benchmarks = do
6868
#ifdef NO_IGNORE_ASSERTS
69-
putStrLn "BENCHMARKING A BUILD WITH -fno-ignore-asserts"
69+
putStrLn "WARNING: Benchmarking in debug mode."
70+
putStrLn " To benchmark in release mode, pass:"
71+
putStrLn " --project-file=cabal.project.release"
7072
#endif
7173

7274
enabled <- getRTSStatsEnabled

bench/macro/lsm-tree-bench-lookups.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ numEntriesFitInPage = fromIntegral unusedPageBits / fromIntegral entryBitsWithOv
130130
benchmarks :: Run.RunDataCaching -> IO ()
131131
benchmarks !caching = withFS $ \hfs hbio -> do
132132
#ifdef NO_IGNORE_ASSERTS
133-
putStrLn "BENCHMARKING A BUILD WITH -fno-ignore-asserts"
133+
putStrLn "WARNING: Benchmarking in debug mode."
134+
putStrLn " To benchmark in release mode, pass:"
135+
putStrLn " --project-file=cabal.project.release"
134136
#endif
135137
arenaManager <- newArenaManager
136138
enabled <- getRTSStatsEnabled

bench/macro/lsm-tree-bench-wp8.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DuplicateRecordFields #-}
23
{-# LANGUAGE OverloadedStrings #-}
34
{-# OPTIONS_GHC -Wno-orphans #-}
@@ -869,6 +870,11 @@ batchOverlaps initialSize batchSize batchCount seed =
869870
main :: IO ()
870871
main = do
871872
hSetBuffering stdout NoBuffering
873+
#ifdef NO_IGNORE_ASSERTS
874+
putStrLn "WARNING: Benchmarking in debug mode."
875+
putStrLn " To benchmark in release mode, pass:"
876+
putStrLn " --project-file=cabal.project.release"
877+
#endif
872878
(gopts, cmd) <- O.customExecParser prefs cliP
873879
print gopts
874880
print cmd

bench/macro/rocksdb-bench-wp8.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DuplicateRecordFields #-}
23
{-# LANGUAGE NondecreasingIndentation #-}
34
{-# LANGUAGE OverloadedStrings #-}
@@ -387,6 +388,11 @@ doRun' gopts opts =
387388

388389
main :: IO ()
389390
main = do
391+
#ifdef NO_IGNORE_ASSERTS
392+
putStrLn "WARNING: Benchmarking in debug mode."
393+
putStrLn " To benchmark in release mode, pass:"
394+
putStrLn " --project-file=cabal.project.release"
395+
#endif
390396
(gopts, cmd) <- O.customExecParser prefs cliP
391397
print gopts
392398
print cmd

0 commit comments

Comments
 (0)