aboutsummaryrefslogtreecommitdiffstats
path: root/src/benchmark/benchmark.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-07-30 16:10:56 +0000
committerlloyd <[email protected]>2010-07-30 16:10:56 +0000
commit6d5b7413ea1873670a2710db70bfb5938dddd4b3 (patch)
tree7cee1b386fe59c120624549d5379c84ce92047a1 /src/benchmark/benchmark.cpp
parent28cbb01e766ed8aab988f6e3a4fd49e21a7aa258 (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.cpp')
-rw-r--r--src/benchmark/benchmark.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/benchmark/benchmark.cpp b/src/benchmark/benchmark.cpp
index 887c64e70..fc4a8ba37 100644
--- a/src/benchmark/benchmark.cpp
+++ b/src/benchmark/benchmark.cpp
@@ -120,9 +120,10 @@ bench_mac(MessageAuthenticationCode* mac,
std::map<std::string, double>
algorithm_benchmark(const std::string& name,
- u32bit milliseconds,
+ Algorithm_Factory& af,
RandomNumberGenerator& rng,
- Algorithm_Factory& af)
+ u32bit milliseconds,
+ u32bit buf_size)
{
std::vector<std::string> providers = af.providers_of(name);
std::map<std::string, double> all_results;
@@ -133,7 +134,7 @@ algorithm_benchmark(const std::string& name,
const u64bit ns_per_provider =
(static_cast<u64bit>(milliseconds) * 1000 * 1000) / providers.size();
- std::vector<byte> buf(16 * 1024);
+ std::vector<byte> buf(buf_size * 1024);
rng.randomize(&buf[0], buf.size());
for(u32bit i = 0; i != providers.size(); ++i)