diff options
author | Guillaume Chatelet <gchatelet@google.com> | 2022-12-01 10:19:16 +0000 |
---|---|---|
committer | Guillaume Chatelet <gchatelet@google.com> | 2022-12-01 10:21:13 +0000 |
commit | bcf394c4d1257890dc5add64c6844b8fddae18ef (patch) | |
tree | 00c3ed5c9726e92ea8b9c7396199fe676d3f2770 /libc/benchmarks | |
parent | ef063270631a9b4a02c12ddd4e0d3f2db610f891 (diff) | |
download | llvm-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.cpp | 4 |
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()); |