MCPcopy Create free account
hub / github.com/LUX-Core/lux / BenchMark

Function BenchMark

src/cryptopp/bench1.cpp:121–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119*/
120
121void BenchMark(const char *name, StreamTransformation &cipher, double timeTotal)
122{
123 const int BUF_SIZE=RoundUpToMultipleOf(2048U, cipher.OptimalBlockSize());
124 AlignedSecByteBlock buf(BUF_SIZE);
125 GlobalRNG().GenerateBlock(buf, BUF_SIZE);
126 clock_t start = clock();
127
128 unsigned long i=0, blocks=1;
129 double timeTaken;
130 do
131 {
132 blocks *= 2;
133 for (; i<blocks; i++)
134 cipher.ProcessString(buf, BUF_SIZE);
135 timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND;
136 }
137 while (timeTaken < 2.0/3*timeTotal);
138
139 OutputResultBytes(name, double(blocks) * BUF_SIZE, timeTaken);
140}
141
142void BenchMark(const char *name, AuthenticatedSymmetricCipher &cipher, double timeTotal)
143{

Callers 2

BenchMarkByName2Function · 0.85
BenchMarkByNameKeyLessFunction · 0.85

Calls 7

RoundUpToMultipleOfFunction · 0.85
OutputResultBytesFunction · 0.85
SpecifyDataLengthsMethod · 0.80
OptimalBlockSizeMethod · 0.45
GenerateBlockMethod · 0.45
UpdateMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected