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

Function Parse3Backtrack

extern/re2/re2/testing/regexp_benchmark.cc:1104–1116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1102}
1103
1104void Parse3Backtrack(benchmark::State& state, const char* regexp,
1105 const StringPiece& text) {
1106 for (auto _ : state) {
1107 Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
1108 CHECK(re);
1109 Prog* prog = re->CompileToProg(0);
1110 CHECK(prog);
1111 StringPiece sp[4]; // 4 because sp[0] is whole match.
1112 CHECK(prog->UnsafeSearchBacktrack(text, text, Prog::kAnchored, Prog::kFullMatch, sp, 4));
1113 delete prog;
1114 re->Decref();
1115 }
1116}
1117
1118void Parse3PCRE(benchmark::State& state, const char* regexp,
1119 const StringPiece& text) {

Callers

nothing calls this directly

Calls 4

ParseFunction · 0.85
CompileToProgMethod · 0.80
UnsafeSearchBacktrackMethod · 0.80
DecrefMethod · 0.45

Tested by

no test coverage detected