RapidFuzz/cpp/main.cpp

21 lines
518 B
C++
Raw Normal View History

2020-02-29 14:45:15 +00:00
#include "process.hpp"
#include <benchmark/benchmark.h>
#include <string>
#include <vector>
// Define another benchmark
static void BM_StringCopy(benchmark::State &state) {
std::string a =
"please add bananas to my shopping list I am a really reeally cool guy";
std::vector<std::string> b(
1000,
"whats the weather like in Paris I am john Peter the new guy in class");
for (auto _ : state) {
benchmark::DoNotOptimize(extract_one(a, b));
}
}
BENCHMARK(BM_StringCopy);
BENCHMARK_MAIN();