From fa00c321073c7ea40a4fc3dfc8a06309eae3d025 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 15 May 2019 12:21:46 -0700 Subject: Export of internal Abseil changes. -- 6258612abc571fa7f51f34046b410c73486505fe by Derek Mauro : Rollback checking the return value of pthread functions in thread_identity.cc. PiperOrigin-RevId: 248381230 -- fda6acddab04fc53eeb84ec253de4a9655bf9a36 by CJ Johnson : Removes too-restrictive benchmark abstraction in inlined_vector_benchmark PiperOrigin-RevId: 248366325 -- 68674991e63c919de8a3eebced5adec6466ec8fe by Abseil Team : Check for pthread_setmask() failure. Log a fatal error message if pthread_setmask() fails. PiperOrigin-RevId: 248347115 -- 45389e44c0d1badafb6b560cae3df99fc8bd16ac by Derek Mauro : Fix a -Wredundant-move warning in GCC 9. PiperOrigin-RevId: 248338682 -- 12cfbacf599084a8ac6bf4395026cbf193c85a26 by Derek Mauro : Check the return value of pthread functions in thread_identity.cc. PiperOrigin-RevId: 248327118 -- 2bc69998e68cfee96e812ce800e83cce7a715091 by Benjamin Barenblat : Encourage judicious use of ABSL_PREDICT_{TRUE,FALSE} Recommend that users use branch prediction annotations only on hot, consistently mispredicted branches. PiperOrigin-RevId: 248222450 GitOrigin-RevId: 6258612abc571fa7f51f34046b410c73486505fe Change-Id: I09d409f9a3941ee926b8476b5473f9c4899cc3ff --- absl/container/inlined_vector_benchmark.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'absl/container/inlined_vector_benchmark.cc') diff --git a/absl/container/inlined_vector_benchmark.cc b/absl/container/inlined_vector_benchmark.cc index 7bb3271b..d906997a 100644 --- a/absl/container/inlined_vector_benchmark.cc +++ b/absl/container/inlined_vector_benchmark.cc @@ -405,12 +405,6 @@ class NontrivialType { using NontrivialVec = absl::InlinedVector; -#define BENCHMARK_OPERATION(BM_Function) \ - BENCHMARK_TEMPLATE(BM_Function, TrivialVec, kSmallSize); \ - BENCHMARK_TEMPLATE(BM_Function, TrivialVec, kLargeSize); \ - BENCHMARK_TEMPLATE(BM_Function, NontrivialVec, kSmallSize); \ - BENCHMARK_TEMPLATE(BM_Function, NontrivialVec, kLargeSize) - template void BatchedBenchmark(benchmark::State& state, PrepareVec prepare_vec, TestVec test_vec) { @@ -432,13 +426,18 @@ void BatchedBenchmark(benchmark::State& state, PrepareVec prepare_vec, } } -template +template void BM_Clear(benchmark::State& state) { BatchedBenchmark( state, - /* prepare_vec = */ [](VecT* vec) { vec->resize(Size); }, + /* prepare_vec = */ [](VecT* vec) { vec->resize(FromSize); }, /* test_vec = */ [](VecT* vec) { vec->clear(); }); } -BENCHMARK_OPERATION(BM_Clear); + +BENCHMARK_TEMPLATE(BM_Clear, TrivialVec, kSmallSize); +BENCHMARK_TEMPLATE(BM_Clear, TrivialVec, kLargeSize); + +BENCHMARK_TEMPLATE(BM_Clear, NontrivialVec, kSmallSize); +BENCHMARK_TEMPLATE(BM_Clear, NontrivialVec, kLargeSize); } // namespace -- cgit v1.2.3