[libc][benchmark] more precise estimate of throughput

This patch increases precision by performing the integer divivion after the
multiplication.
This commit is contained in:
Guillaume Chatelet 2022-12-01 10:19:16 +00:00
parent ef06327063
commit bcf394c4d1

View File

@ -49,8 +49,8 @@ template <typename SetupType, typename ConfigurationType> struct Runner {
}
~Runner() {
const size_t AvgBytesPerIteration = Setup.getBatchBytes() / Setup.BatchSize;
const size_t TotalBytes = State.iterations() * AvgBytesPerIteration;
const size_t TotalBytes =
(State.iterations() * Setup.getBatchBytes()) / Setup.BatchSize;
State.SetBytesProcessed(TotalBytes);
State.SetItemsProcessed(State.iterations());
State.SetLabel((Twine(Configuration.Name) + "," + Distribution.Name).str());