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

Function SearchPhone

extern/re2/re2/testing/regexp_benchmark.cc:775–780  ·  view source on GitHub ↗

Makes text of size nbytes, then calls run to search the text for regexp iters times.

Source from the content-addressed store, hash-verified

773// Makes text of size nbytes, then calls run to search
774// the text for regexp iters times.
775void SearchPhone(benchmark::State& state, ParseImpl* search) {
776 std::string s = RandomText(state.range(0));
777 s.append("(650) 253-0001");
778 search(state, "(\\d{3}-|\\(\\d{3}\\)\\s+)(\\d{3}-\\d{4})", s);
779 state.SetBytesProcessed(state.iterations() * state.range(0));
780}
781
782void SearchPhone_CachedPCRE(benchmark::State& state) {
783 SearchPhone(state, SearchParse2CachedPCRE);

Callers 2

SearchPhone_CachedPCREFunction · 0.85
SearchPhone_CachedRE2Function · 0.85

Calls 6

RandomTextFunction · 0.85
rangeMethod · 0.80
SetBytesProcessedMethod · 0.80
iterationsMethod · 0.80
searchFunction · 0.50
appendMethod · 0.45

Tested by

no test coverage detected