From 4832049e5c050cd4b50182d0fc061b99bf64b4b6 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 14 Sep 2022 07:12:47 -0700 Subject: Add more options for `BM_iteration` in order to see better picture for choosing trade off for iteration optimizations. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` BM_Iteration/1/1 1.83ns ± 0% BM_Iteration/2/2 2.63ns ±11% BM_Iteration/4/4 5.76ns ±26% BM_Iteration/7/7 3.79ns ± 0% BM_Iteration/10/10 8.49ns ±23% BM_Iteration/15/15 18.2ns ±30% BM_Iteration/16/16 21.2ns ±29% BM_Iteration/54/54 37.2ns ±21% BM_Iteration/100/100 74.7ns ±13% BM_Iteration/400/400 330ns ± 8% BM_Iteration/0/0 0.46ns ± 2% BM_Iteration/10/0 1.26ns ± 1% BM_Iteration/100/0 13.4ns ± 0% BM_Iteration/1000/0 417ns ± 0% BM_Iteration/10000/0 3.30µs ± 0% BM_Iteration/100/1 16.0ns ±12% BM_Iteration/1000/10 453ns ± 5% ``` PiperOrigin-RevId: 474282700 Change-Id: I4b3fcb80292147aa4a8f542ae5c7fc1e8bd5f05b --- absl/container/internal/raw_hash_set_benchmark.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/absl/container/internal/raw_hash_set_benchmark.cc b/absl/container/internal/raw_hash_set_benchmark.cc index fdec769b..4c61d84c 100644 --- a/absl/container/internal/raw_hash_set_benchmark.cc +++ b/absl/container/internal/raw_hash_set_benchmark.cc @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include #include +#include #include #include @@ -235,10 +238,22 @@ void BM_Iteration(benchmark::State& state) { } BENCHMARK(BM_Iteration) + ->ArgPair(1, 1) + ->ArgPair(2, 2) + ->ArgPair(4, 4) + ->ArgPair(7, 7) ->ArgPair(10, 10) - ->ArgPair(20, 20) + ->ArgPair(15, 15) + ->ArgPair(16, 16) + ->ArgPair(54, 54) ->ArgPair(100, 100) ->ArgPair(400, 400) + // empty + ->ArgPair(0, 0) + ->ArgPair(10, 0) + ->ArgPair(100, 0) + ->ArgPair(1000, 0) + ->ArgPair(10000, 0) // sparse ->ArgPair(100, 1) ->ArgPair(1000, 10); -- cgit v1.2.3