improve benchmark --databases
* benchmark: Changed --databases to take a parameter specifiying the size of the database to benchmark. * benchmark --databases: Display size of the populated database. * benchmark --databases: Improve the "addAssociatedFile to (new)" benchmark to really add new values, not overwriting old values.
This commit is contained in:
parent
8ea5f3ff99
commit
25ba8156bc
4 changed files with 29 additions and 24 deletions
|
@ -26,7 +26,7 @@ cmd generator = command "benchmark" SectionTesting
|
|||
|
||||
data BenchmarkOptions
|
||||
= BenchmarkOptions CmdParams CriterionMode
|
||||
| BenchmarkDatabases CriterionMode
|
||||
| BenchmarkDatabases CriterionMode Integer
|
||||
|
||||
optParser :: CmdParamsDesc -> Parser BenchmarkOptions
|
||||
optParser desc = benchmarkoptions <|> benchmarkdatabases
|
||||
|
@ -36,10 +36,11 @@ optParser desc = benchmarkoptions <|> benchmarkdatabases
|
|||
<*> criterionopts
|
||||
benchmarkdatabases = BenchmarkDatabases
|
||||
<$> criterionopts
|
||||
<* flag' ()
|
||||
( long "databases"
|
||||
<*> option auto
|
||||
( long "databases"
|
||||
<> metavar paramNumber
|
||||
<> help "benchmark sqlite databases"
|
||||
)
|
||||
)
|
||||
#ifdef WITH_BENCHMARK
|
||||
criterionopts = parseWith defaultConfig
|
||||
#else
|
||||
|
@ -51,7 +52,7 @@ seek :: BenchmarkGenerator -> BenchmarkOptions -> CommandSeek
|
|||
seek generator (BenchmarkOptions ps mode) = do
|
||||
runner <- generator ps
|
||||
liftIO $ runMode mode [ bench (unwords ps) $ nfIO runner ]
|
||||
seek _ (BenchmarkDatabases mode) = benchmarkDbs mode
|
||||
seek _ (BenchmarkDatabases mode n) = benchmarkDbs mode n
|
||||
#else
|
||||
seek _ _ = giveup "git-annex is not built with benchmarking support"
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue