Makes text of size nbytes, then calls run to search the text for regexp iters times.
| 773 | // Makes text of size nbytes, then calls run to search |
| 774 | // the text for regexp iters times. |
| 775 | void 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 | |
| 782 | void SearchPhone_CachedPCRE(benchmark::State& state) { |
| 783 | SearchPhone(state, SearchParse2CachedPCRE); |
no test coverage detected