summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-01-12 13:15:15 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-01-12 13:15:15 -0400
commitb8f03df07060daba1636ee41a20bd8438badc331 (patch)
tree02d23b1ccea61a8f31590a34289ab145f2c8fdeb
parente4a7f05ccbbff12081ace7be6786ec891d185e9a (diff)
refactor
-rw-r--r--Command/Benchmark.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Command/Benchmark.hs b/Command/Benchmark.hs
index d4585fdb8..66af1f98c 100644
--- a/Command/Benchmark.hs
+++ b/Command/Benchmark.hs
@@ -41,9 +41,7 @@ benchmark _ = withTmpDirIn "." "benchmark" $ \tmpdir -> do
, 10000
-- , 100000
]
- -- can't use Criterion's defaultMain here because it looks at
- -- command-line parameters
- withConfig defaultConfig $ runAndAnalyse (const True) $
+ runCriterion $
bgroup "keys database" $ flip concatMap dbs $ \db ->
[ getAssociatedFilesHitBench db
, getAssociatedFilesMissBench db
@@ -104,3 +102,8 @@ instance NFData TopFilePath where
instance NFData SKey where
rnf (SKey s) = rnf s
+
+-- can't use Criterion's defaultMain here because it looks at
+-- command-line parameters
+runCriterion :: Benchmark -> IO ()
+runCriterion = withConfig defaultConfig . runAndAnalyse (const True)