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

Function Parse1OnePass

extern/re2/re2/testing/regexp_benchmark.cc:1213–1226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1211}
1212
1213void Parse1OnePass(benchmark::State& state, const char* regexp,
1214 const StringPiece& text) {
1215 for (auto _ : state) {
1216 Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
1217 CHECK(re);
1218 Prog* prog = re->CompileToProg(0);
1219 CHECK(prog);
1220 CHECK(prog->IsOnePass());
1221 StringPiece sp[2]; // 2 because sp[0] is whole match.
1222 CHECK(prog->SearchOnePass(text, text, Prog::kAnchored, Prog::kFullMatch, sp, 2));
1223 delete prog;
1224 re->Decref();
1225 }
1226}
1227
1228void Parse1BitState(benchmark::State& state, const char* regexp,
1229 const StringPiece& text) {

Callers

nothing calls this directly

Calls 5

ParseFunction · 0.85
CompileToProgMethod · 0.80
IsOnePassMethod · 0.80
SearchOnePassMethod · 0.80
DecrefMethod · 0.45

Tested by

no test coverage detected