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

Function Parse3NFA

extern/re2/re2/testing/regexp_benchmark.cc:1059–1072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1057// extracting three submatches. Expects match always.
1058
1059void Parse3NFA(benchmark::State& state, const char* regexp,
1060 const StringPiece& text) {
1061 for (auto _ : state) {
1062 Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
1063 CHECK(re);
1064 Prog* prog = re->CompileToProg(0);
1065 CHECK(prog);
1066 StringPiece sp[4]; // 4 because sp[0] is whole match.
1067 CHECK(prog->SearchNFA(text, StringPiece(), Prog::kAnchored,
1068 Prog::kFullMatch, sp, 4));
1069 delete prog;
1070 re->Decref();
1071 }
1072}
1073
1074void Parse3OnePass(benchmark::State& state, const char* regexp,
1075 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