MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / FullMatchPCRE

Function FullMatchPCRE

extern/re2/re2/testing/regexp_benchmark.cc:1483–1491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1481BENCHMARK(ASCIIMatchRE2)->ThreadRange(1, NumCPUs());
1482
1483void FullMatchPCRE(benchmark::State& state, const char *regexp) {
1484 std::string s = RandomText(state.range(0));
1485 s += "ABCDEFGHIJ";
1486 PCRE re(regexp);
1487 for (auto _ : state) {
1488 CHECK(PCRE::FullMatch(s, re));
1489 }
1490 state.SetBytesProcessed(state.iterations() * state.range(0));
1491}
1492
1493void FullMatchRE2(benchmark::State& state, const char *regexp) {
1494 std::string s = RandomText(state.range(0));

Calls 4

RandomTextFunction · 0.85
rangeMethod · 0.80
SetBytesProcessedMethod · 0.80
iterationsMethod · 0.80

Tested by

no test coverage detected