aboutsummaryrefslogtreecommitdiffstats
path: root/checks/bench.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-07-30 16:20:46 +0000
committerlloyd <[email protected]>2010-07-30 16:20:46 +0000
commitb067a61fe565161c2915cfddf316cbb45849f461 (patch)
tree93d359dec61f6dbfb42e76d76b2762892c29cae7 /checks/bench.cpp
parent6d5b7413ea1873670a2710db70bfb5938dddd4b3 (diff)
Add a new option for benchmarking --buf-size which specifies the size of
the buffer (in KiB) to process.
Diffstat (limited to 'checks/bench.cpp')
-rw-r--r--checks/bench.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/checks/bench.cpp b/checks/bench.cpp
index 5ee50d89d..8d35ac1c4 100644
--- a/checks/bench.cpp
+++ b/checks/bench.cpp
@@ -162,14 +162,15 @@ void report_results(const std::string& algo,
bool bench_algo(const std::string& algo,
Botan::RandomNumberGenerator& rng,
- double seconds)
+ double seconds,
+ u32bit buf_size)
{
Botan::Algorithm_Factory& af = Botan::global_state().algorithm_factory();
u32bit milliseconds = static_cast<u32bit>(seconds * 1000);
std::map<std::string, double> speeds =
- algorithm_benchmark(algo, milliseconds, rng, af);
+ algorithm_benchmark(algo, af, rng, milliseconds, buf_size);
if(speeds.empty()) // maybe a cipher mode, then?
{
@@ -243,8 +244,8 @@ bool bench_algo(const std::string& algo,
}
void benchmark(Botan::RandomNumberGenerator& rng,
- double seconds)
+ double seconds, u32bit buf_size)
{
for(u32bit i = 0; algos[i] != ""; ++i)
- bench_algo(algos[i], rng, seconds);
+ bench_algo(algos[i], rng, seconds, buf_size);
}