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

Function Parse1NFA

extern/re2/re2/testing/regexp_benchmark.cc:1198–1211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1196// extracting three submatches. Expects match always.
1197
1198void Parse1NFA(benchmark::State& state, const char* regexp,
1199 const StringPiece& text) {
1200 for (auto _ : state) {
1201 Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
1202 CHECK(re);
1203 Prog* prog = re->CompileToProg(0);
1204 CHECK(prog);
1205 StringPiece sp[2]; // 2 because sp[0] is whole match.
1206 CHECK(prog->SearchNFA(text, StringPiece(), Prog::kAnchored,
1207 Prog::kFullMatch, sp, 2));
1208 delete prog;
1209 re->Decref();
1210 }
1211}
1212
1213void Parse1OnePass(benchmark::State& state, const char* regexp,
1214 const StringPiece& text) {

Callers

nothing calls this directly

Calls 5

ParseFunction · 0.85
StringPieceClass · 0.85
CompileToProgMethod · 0.80
SearchNFAMethod · 0.80
DecrefMethod · 0.45

Tested by

no test coverage detected