2025-09-29 21:20:44 +08:00
|
|
|
#include <benchmark/benchmark.h>
|
|
|
|
#include <yycc.hpp>
|
|
|
|
#include <yycc/string/op.hpp>
|
|
|
|
|
|
|
|
#define OP ::yycc::string::op
|
|
|
|
using namespace std::literals::string_view_literals;
|
|
|
|
|
|
|
|
namespace yyccbench::string::op {
|
|
|
|
|
2025-09-29 22:43:28 +08:00
|
|
|
static void BM_StringStrip(benchmark::State& state) {
|
2025-09-29 21:20:44 +08:00
|
|
|
std::u8string_view strl = u8" \thello\r\n"sv, words = u8" \t\r\n"sv;
|
|
|
|
for (auto _ : state) {
|
|
|
|
auto rv = OP::strip(strl, words);
|
|
|
|
}
|
|
|
|
}
|
2025-09-29 22:43:28 +08:00
|
|
|
BENCHMARK(BM_StringStrip)->Name("StringStrip");
|
2025-09-29 21:20:44 +08:00
|
|
|
|
|
|
|
}
|