diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-08-16 13:07:43 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-08-16 13:08:13 -0400 |
commit | 3229b02f0aa6bb23e351d00ade1263851a2f1826 (patch) | |
tree | d6dd95a8c9cd72f0355cbbb40f49888708ba986d /ExpensiveHash.hs | |
parent | 3b4a775d536b2b2956269a59f886487efe29ed51 (diff) | |
download | keysafe-3229b02f0aa6bb23e351d00ade1263851a2f1826.tar.gz |
add --benchmark
Diffstat (limited to 'ExpensiveHash.hs')
-rw-r--r-- | ExpensiveHash.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ExpensiveHash.hs b/ExpensiveHash.hs index 3d832fb..0e33604 100644 --- a/ExpensiveHash.hs +++ b/ExpensiveHash.hs @@ -42,7 +42,7 @@ expensiveHash (UseArgon2 cost opts) (Salt s) b = ExpensiveHash cost $ let sb = toByteString s in sb <> B.replicate (8 - B.length sb ) 32 -benchmarkExpensiveHash :: Int -> ExpensiveHashTunable -> Cost op -> IO (Benchmark (Cost op)) +benchmarkExpensiveHash :: Int -> ExpensiveHashTunable -> Cost op -> IO (BenchmarkResult (Cost op)) benchmarkExpensiveHash rounds tunables expected = do start <- getCurrentTime forM_ [1..rounds] $ \_ -> do @@ -53,7 +53,7 @@ benchmarkExpensiveHash rounds tunables expected = do end <- getCurrentTime let diff = floor $ end `diffUTCTime` start let actual = CPUCost $ Seconds diff - return $ Benchmark + return $ BenchmarkResult { expectedBenchmark = expected , actualBenchmark = actual } |