diff options
author | lloyd <[email protected]> | 2010-07-30 16:10:56 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-07-30 16:10:56 +0000 |
commit | 6d5b7413ea1873670a2710db70bfb5938dddd4b3 (patch) | |
tree | 7cee1b386fe59c120624549d5379c84ce92047a1 /src/benchmark/benchmark.h | |
parent | 28cbb01e766ed8aab988f6e3a4fd49e21a7aa258 (diff) |
Change the benchmark code to also take a buf_size, instead of using hardcoded
16 KiB buffer. Also reorder the parameters to make somewhat more sense, with the
first arguments being totally mandatory and the later ones potentially optional.
Provide inlined version matching the old interface that just forwards to the
new call, marking it as deprecated.
Diffstat (limited to 'src/benchmark/benchmark.h')
-rw-r--r-- | src/benchmark/benchmark.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/benchmark/benchmark.h b/src/benchmark/benchmark.h index 4f1d91b79..304fae2fc 100644 --- a/src/benchmark/benchmark.h +++ b/src/benchmark/benchmark.h @@ -18,16 +18,36 @@ namespace Botan { /** * Algorithm benchmark * @param name the name of the algorithm to test (cipher, hash, or MAC) -* @param milliseconds total time for the benchmark to run -* @param rng the rng to use to generate random inputs * @param af the algorithm factory used to create objects +* @param rng the rng to use to generate random inputs +* @param milliseconds total time for the benchmark to run +* @param buf_size size of buffer to benchmark against, in KiB * @return results a map from provider to speed in mebibytes per second */ std::map<std::string, double> BOTAN_DLL algorithm_benchmark(const std::string& name, - u32bit milliseconds, + Algorithm_Factory& af, RandomNumberGenerator& rng, - Algorithm_Factory& af); + u32bit milliseconds, + u32bit buf_size); + +/** +* Algorithm benchmark (1.8 compatability version) +* @deprecated Use variant taking buf_size defined above +* @param name the name of the algorithm to test (cipher, hash, or MAC) +* @param milliseconds total time for the benchmark to run +* @param rng the rng to use to generate random inputs +* @param af the algorithm factory used to create objects +* @return results a map from provider to speed in mebibytes per second +*/ +std::map<std::string, double> +inline algorithm_benchmark(const std::string& name, + u32bit milliseconds, + RandomNumberGenerator& rng, + Algorithm_Factory& af) + { + return algorithm_benchmark(name, af, rng, milliseconds, 16); + } } |