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

Function Parse3OnePass

extern/re2/re2/testing/regexp_benchmark.cc:1074–1087  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1072}
1073
1074void Parse3OnePass(benchmark::State& state, const char* regexp,
1075 const StringPiece& text) {
1076 for (auto _ : state) {
1077 Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
1078 CHECK(re);
1079 Prog* prog = re->CompileToProg(0);
1080 CHECK(prog);
1081 CHECK(prog->IsOnePass());
1082 StringPiece sp[4]; // 4 because sp[0] is whole match.
1083 CHECK(prog->SearchOnePass(text, text, Prog::kAnchored, Prog::kFullMatch, sp, 4));
1084 delete prog;
1085 re->Decref();
1086 }
1087}
1088
1089void Parse3BitState(benchmark::State& state, const char* regexp,
1090 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