diff options
author | Colin Cross <ccross@android.com> | 2022-01-24 20:27:14 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2022-04-12 12:11:06 -0700 |
commit | 36ccdba805f1322c23714dbeb227fb632b54ae45 (patch) | |
tree | 2ce94d7f0804ccb77d1fa9b2a1bca00eecdff1e2 /third_party/abseil-cpp/absl/container/inlined_vector_benchmark.cc | |
parent | ebc7d1eda6f23c4fa070f527fa557ba750fa30b0 (diff) | |
download | webrtc-36ccdba805f1322c23714dbeb227fb632b54ae45.tar.gz |
Update webrtc's abseil-cpp
Copy external/abseil-cpp into webrtc to update to version 20211102.0
to pick up changes that fix compiling against musl libc.
Bug: 190084016
Test: m USE_HOST_MUSL=true host-native
Test: m checkbuild
Change-Id: I0ab600cd8db93a55eda8358cdbecd21c2f78d8fb
Diffstat (limited to 'third_party/abseil-cpp/absl/container/inlined_vector_benchmark.cc')
-rw-r--r-- | third_party/abseil-cpp/absl/container/inlined_vector_benchmark.cc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/third_party/abseil-cpp/absl/container/inlined_vector_benchmark.cc b/third_party/abseil-cpp/absl/container/inlined_vector_benchmark.cc index 3f2b4ed28a..e256fad60f 100644 --- a/third_party/abseil-cpp/absl/container/inlined_vector_benchmark.cc +++ b/third_party/abseil-cpp/absl/container/inlined_vector_benchmark.cc @@ -83,7 +83,7 @@ int GetNonShortStringOptimizationSize() { } ABSL_RAW_LOG( FATAL, - "Failed to find a std::string larger than the short std::string optimization"); + "Failed to find a string larger than the short string optimization"); return -1; } @@ -534,6 +534,28 @@ void BM_ConstructFromMove(benchmark::State& state) { ABSL_INTERNAL_BENCHMARK_ONE_SIZE(BM_ConstructFromMove, TrivialType); ABSL_INTERNAL_BENCHMARK_ONE_SIZE(BM_ConstructFromMove, NontrivialType); +// Measure cost of copy-constructor+destructor. +void BM_CopyTrivial(benchmark::State& state) { + const int n = state.range(0); + InlVec<int64_t> src(n); + for (auto s : state) { + InlVec<int64_t> copy(src); + benchmark::DoNotOptimize(copy); + } +} +BENCHMARK(BM_CopyTrivial)->Arg(0)->Arg(1)->Arg(kLargeSize); + +// Measure cost of copy-constructor+destructor. +void BM_CopyNonTrivial(benchmark::State& state) { + const int n = state.range(0); + InlVec<InlVec<int64_t>> src(n); + for (auto s : state) { + InlVec<InlVec<int64_t>> copy(src); + benchmark::DoNotOptimize(copy); + } +} +BENCHMARK(BM_CopyNonTrivial)->Arg(0)->Arg(1)->Arg(kLargeSize); + template <typename T, size_t FromSize, size_t ToSize> void BM_AssignSizeRef(benchmark::State& state) { auto size = ToSize; |