QBenchlib: force the warmup to run a single iteration

The purpose of warming up is to get all code paths executed, so any lazy
function resolving is processed, statics are allocated, etc. There's no
reason to run it more than once -- if you're trying to train the Branch
Predictor Unit, you'd want to do it another way anyway. This is useful
when benchmarking with -iterations N, because QBenchlib currently runs
2*N iterations because of the warm up. That just wastes time.

Change-Id: I3c79b7e08fa346988dfefffd172030c889b31a1f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Thiago Macieira 2022-10-21 13:51:39 -07:00
parent 10d5c0adaf
commit feb6463772

View File

@ -1117,6 +1117,8 @@ void TestMethods::invokeTestOnData(int index) const
bool minimumTotalReached = false;
do {
QBenchmarkTestMethodData::current->beginDataRun();
if (i < 0)
QBenchmarkTestMethodData::current->iterationCount = 1;
/* Benchmarking: for each accumulation iteration*/
bool invokeOk;