From 4fef9b88371acde819cd431f4e099e7e511606e4 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 19 May 2017 23:29:59 -0400 Subject: Rework benchmark code This change moves test selections from test.cpp into bench.cpp. It also allows us finer control over test classes and algorithms --- bench.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bench.h') diff --git a/bench.h b/bench.h index a30b22ef..d16f7462 100644 --- a/bench.h +++ b/bench.h @@ -14,7 +14,14 @@ NAMESPACE_BEGIN(CryptoPP) NAMESPACE_BEGIN(Test) -enum TestClass {Unkeyed=1,SharedKey=2,PublicKey=4, All=Unkeyed|SharedKey|PublicKey}; +// More granular control over benchmarks +enum TestClass { + Unkeyed=1,SharedKeyMAC=2,SharedKeyStream=4,SharedKeyBlock=8,SharedKeyOther=16, + PublicKeyAgreement=32,PublicKeyEncryption=64,PublicKeySignature=128,PublicKeyOther=256, + SharedKey=SharedKeyMAC|SharedKeyStream|SharedKeyBlock|SharedKeyOther, + PublicKey=PublicKeyAgreement|PublicKeyEncryption|PublicKeySignature|PublicKeyOther, + All=Unkeyed|SharedKey|PublicKey +}; extern const double CLOCK_TICKS_PER_SECOND; extern double g_allocatedTime; @@ -27,6 +34,8 @@ extern const byte defaultKey[]; extern time_t g_testBegin; extern time_t g_testEnd; +// Command handler +void BenchmarkWithCommand(int argc, const char* const argv[]); // Top level, prints preamble and postamble void Benchmark(Test::TestClass suites, double t, double hertz); // Unkeyed systems -- cgit v1.2.1