summaryrefslogtreecommitdiff
path: root/libc/benchmarks
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2022-12-01 10:19:16 +0000
committerGuillaume Chatelet <gchatelet@google.com>2022-12-01 10:21:13 +0000
commitbcf394c4d1257890dc5add64c6844b8fddae18ef (patch)
tree00c3ed5c9726e92ea8b9c7396199fe676d3f2770 /libc/benchmarks
parentef063270631a9b4a02c12ddd4e0d3f2db610f891 (diff)
downloadllvm-bcf394c4d1257890dc5add64c6844b8fddae18ef.tar.gz
[libc][benchmark] more precise estimate of throughput
This patch increases precision by performing the integer divivion after the multiplication.
Diffstat (limited to 'libc/benchmarks')
-rw-r--r--libc/benchmarks/LibcMemoryGoogleBenchmarkMain.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/benchmarks/LibcMemoryGoogleBenchmarkMain.cpp b/libc/benchmarks/LibcMemoryGoogleBenchmarkMain.cpp
index 1e7f35b9c3d7..164708ad1a05 100644
--- a/libc/benchmarks/LibcMemoryGoogleBenchmarkMain.cpp
+++ b/libc/benchmarks/LibcMemoryGoogleBenchmarkMain.cpp
@@ -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());