@@ -49,7 +49,7 @@ static void BLS_PubKeyAggregate_Normal(benchmark::Bench& bench)
4949 CBLSPublicKey pubKey2 = secKey2.GetPublicKey ();
5050
5151 // Benchmark.
52- bench.minEpochIterations (100 ).run ([&] {
52+ bench.minEpochIterations (bench. output () ? 100 : 1 ).run ([&] {
5353 pubKey1.AggregateInsecure (pubKey2);
5454 });
5555}
@@ -126,10 +126,10 @@ static void BLS_Verify_LargeBlock(size_t txCount, benchmark::Bench& bench, uint3
126126 std::vector<CBLSSignature> sigs;
127127 std::vector<uint256> msgHashes;
128128 std::vector<bool > invalid;
129- BuildTestVectors (txCount, 0 , pubKeys, secKeys, sigs, msgHashes, invalid);
129+ BuildTestVectors (bench. output () ? txCount : 1 , 0 , pubKeys, secKeys, sigs, msgHashes, invalid);
130130
131131 // Benchmark.
132- bench.minEpochIterations (epoch_iters).run ([&] {
132+ bench.minEpochIterations (bench. output () ? epoch_iters : 1 ).run ([&] {
133133 for (size_t i = 0 ; i < pubKeys.size (); i++) {
134134 bool ok = sigs[i].VerifyInsecure (pubKeys[i], msgHashes[i]);
135135 assert (ok);
@@ -154,10 +154,10 @@ static void BLS_Verify_LargeBlockSelfAggregated(size_t txCount, benchmark::Bench
154154 std::vector<CBLSSignature> sigs;
155155 std::vector<uint256> msgHashes;
156156 std::vector<bool > invalid;
157- BuildTestVectors (txCount, 0 , pubKeys, secKeys, sigs, msgHashes, invalid);
157+ BuildTestVectors (bench. output () ? txCount : 1 , 0 , pubKeys, secKeys, sigs, msgHashes, invalid);
158158
159159 // Benchmark.
160- bench.minEpochIterations (epoch_iters).run ([&] {
160+ bench.minEpochIterations (bench. output () ? epoch_iters : 1 ).run ([&] {
161161 CBLSSignature aggSig = CBLSSignature::AggregateInsecure (sigs);
162162 bool ok = aggSig.VerifyInsecureAggregated (pubKeys, msgHashes);
163163 assert (ok);
@@ -181,12 +181,12 @@ static void BLS_Verify_LargeAggregatedBlock(size_t txCount, benchmark::Bench& be
181181 std::vector<CBLSSignature> sigs;
182182 std::vector<uint256> msgHashes;
183183 std::vector<bool > invalid;
184- BuildTestVectors (txCount, 0 , pubKeys, secKeys, sigs, msgHashes, invalid);
184+ BuildTestVectors (bench. output () ? txCount : 1 , 0 , pubKeys, secKeys, sigs, msgHashes, invalid);
185185
186186 CBLSSignature aggSig = CBLSSignature::AggregateInsecure (sigs);
187187
188188 // Benchmark.
189- bench.minEpochIterations (epoch_iters).run ([&] {
189+ bench.minEpochIterations (bench. output () ? epoch_iters : 1 ).run ([&] {
190190 bool ok = aggSig.VerifyInsecureAggregated (pubKeys, msgHashes);
191191 assert (ok);
192192 });
@@ -224,7 +224,7 @@ static void BLS_Verify_LargeAggregatedBlock1000PreVerified(benchmark::Bench& ben
224224 }
225225
226226 // Benchmark.
227- bench.minEpochIterations (10 ).run ([&] {
227+ bench.minEpochIterations (bench. output () ? 10 : 1 ).run ([&] {
228228 std::vector<CBLSPublicKey> nonvalidatedPubKeys;
229229 std::vector<uint256> nonvalidatedHashes;
230230 nonvalidatedPubKeys.reserve (pubKeys.size ());
@@ -255,13 +255,13 @@ static void BLS_Verify_Batched(benchmark::Bench& bench)
255255 std::vector<CBLSSignature> sigs;
256256 std::vector<uint256> msgHashes;
257257 std::vector<bool > invalid;
258- BuildTestVectors (1000 , 10 , pubKeys, secKeys, sigs, msgHashes, invalid);
258+ BuildTestVectors (bench. output () ? 1000 : 1 , 10 , pubKeys, secKeys, sigs, msgHashes, invalid);
259259
260260 // Benchmark.
261261 size_t i = 0 ;
262262 size_t j = 0 ;
263263 size_t batchSize = 16 ;
264- bench.minEpochIterations (1000 ).run ([&] {
264+ bench.minEpochIterations (bench. output () ? 1000 : 1 ).run ([&] {
265265 j++;
266266 if ((j % batchSize) != 0 ) {
267267 return ;
@@ -311,7 +311,7 @@ static void BLS_Verify_BatchedParallel(benchmark::Bench& bench)
311311 std::vector<CBLSSignature> sigs;
312312 std::vector<uint256> msgHashes;
313313 std::vector<bool > invalid;
314- BuildTestVectors (1000 , 10 , pubKeys, secKeys, sigs, msgHashes, invalid);
314+ BuildTestVectors (bench. output () ? 1000 : 1 , 10 , pubKeys, secKeys, sigs, msgHashes, invalid);
315315
316316 std::list<std::pair<size_t , std::future<bool >>> futures;
317317
@@ -324,7 +324,7 @@ static void BLS_Verify_BatchedParallel(benchmark::Bench& bench)
324324 blsWorker.Start ();
325325
326326 // Benchmark.
327- bench.minEpochIterations (1000 ).run ([&] {
327+ bench.minEpochIterations (bench. output () ? 1000 : 1 ).run ([&] {
328328 if (futures.size () < 100 ) {
329329 while (futures.size () < 10000 ) {
330330 size_t i = 0 ;
0 commit comments