buildtools/third_party/libc++/trunk/benchmarks/string.bench.cpp
// Benchmark when the string matches first time.
Benchmark when the string matches first time.
Benchmark when the string matches first time .
static void BM_StringFindAllMatch(benchmark::State &state) {
  std::string s1(MAX_STRING_LEN, '-');
  std::string s2(state.range(0), '-');
  while (state.KeepRunning())
    benchmark::DoNotOptimize(s1.find(s2));
}
static void BM_StringFindAllMatch ( benchmark :: State & state ) { std :: string s1 ( MAX_STRING_LEN , ' ' ) ; std :: string s2 ( state . range ( 0 ) , ' ' ) ; while ( state . KeepRunning ( ) ) benchmark :: DoNotOptimize ( s1 . find ( s2 ) ) ; }
Benchmark when the string matches first time.
Benchmark when the string matches first time .