Skip to content

Commit 65dc0d4

Browse files
committed
[libc++] Remove string benchmark for internal function
We strive to keep our benchmarks portable, so we should only benchmark standard APIs.
1 parent edd1360 commit 65dc0d4

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

libcxx/test/benchmarks/containers/string.bench.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -237,29 +237,6 @@ struct StringMove {
237237
static std::string name() { return "BM_StringMove" + Length::name(); }
238238
};
239239

240-
template <class Length, class Opaque>
241-
struct StringResizeDefaultInit {
242-
static void run(benchmark::State& state) {
243-
constexpr bool opaque = Opaque{} == Opacity::Opaque;
244-
constexpr int kNumStrings = 4 << 10;
245-
size_t length = makeString(Length()).size();
246-
std::string strings[kNumStrings];
247-
while (state.KeepRunningBatch(kNumStrings)) {
248-
state.PauseTiming();
249-
for (int i = 0; i < kNumStrings; ++i) {
250-
std::string().swap(strings[i]);
251-
}
252-
benchmark::DoNotOptimize(strings);
253-
state.ResumeTiming();
254-
for (int i = 0; i < kNumStrings; ++i) {
255-
strings[i].__resize_default_init(maybeOpaque(length, opaque));
256-
}
257-
}
258-
}
259-
260-
static std::string name() { return "BM_StringResizeDefaultInit" + Length::name() + Opaque::name(); }
261-
};
262-
263240
template <class Length, class Opaque>
264241
struct StringAssignStr {
265242
static void run(benchmark::State& state) {
@@ -577,7 +554,6 @@ int main(int argc, char** argv) {
577554
makeCartesianProductBenchmark<StringCopy, AllLengths>();
578555
makeCartesianProductBenchmark<StringMove, AllLengths>();
579556
makeCartesianProductBenchmark<StringDestroy, AllLengths>();
580-
makeCartesianProductBenchmark<StringResizeDefaultInit, AllLengths, AllOpacity>();
581557
makeCartesianProductBenchmark<StringEraseToEnd, AllLengths, AllOpacity>();
582558
makeCartesianProductBenchmark<StringEraseWithMove, AllLengths, AllOpacity>();
583559
makeCartesianProductBenchmark<StringRelational, AllRelations, AllLengths, AllLengths, AllDiffTypes>();

0 commit comments

Comments
 (0)