benchmark: Add --databases to benchmark sqlite databases
Rescued from commit 11d6e2e260
which removed
db benchmarks in favor of benchmarking arbitrary git-annex commands. Which
is nice and general, but microbenchmarks are useful too.
This commit is contained in:
parent
25f912de5b
commit
e1b21a0491
1 changed files with 2 additions and 4 deletions
|
@ -64,13 +64,11 @@ getAssociatedFilesMissBench (BenchDb h num) = bench ("getAssociatedFiles from "
|
|||
getAssociatedKeyHitBench :: BenchDb -> Benchmark
|
||||
getAssociatedKeyHitBench (BenchDb h num) = bench ("getAssociatedKey from " ++ show num ++ " (hit)") $ nfIO $ do
|
||||
n <- getStdRandom (randomR (1,num))
|
||||
-- fromIKey because this ends up being used to get a Key
|
||||
map fromIKey <$> SQL.getAssociatedKey (fileN n) (SQL.ReadHandle h)
|
||||
SQL.getAssociatedKey (fileN n) (SQL.ReadHandle h)
|
||||
|
||||
getAssociatedKeyMissBench :: BenchDb -> Benchmark
|
||||
getAssociatedKeyMissBench (BenchDb h num) = bench ("getAssociatedKey from " ++ show num ++ " (miss)") $ nfIO $
|
||||
-- fromIKey because this ends up being used to get a Key
|
||||
map fromIKey <$> SQL.getAssociatedKey fileMiss (SQL.ReadHandle h)
|
||||
SQL.getAssociatedKey fileMiss (SQL.ReadHandle h)
|
||||
|
||||
addAssociatedFileOldBench :: BenchDb -> Benchmark
|
||||
addAssociatedFileOldBench (BenchDb h num) = bench ("addAssociatedFile to " ++ show num ++ " (old)") $ nfIO $ do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue