aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-01-03 04:13:47 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-01-03 04:13:47 +0300
commit42820c4161edcabb1e36336d175bb8645f529df3 (patch)
treec65cec6d00a0494ea26b9f45903eb512f5e6e302 /test
parentcmake: don't install benchmark the library (diff)
downloadmath-server-42820c4161edcabb1e36336d175bb8645f529df3.tar.gz
math-server-42820c4161edcabb1e36336d175bb8645f529df3.zip
lexer: add alternative boost::regex implementations
Diffstat (limited to 'test')
-rw-r--r--test/benchmarks/lexer.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/benchmarks/lexer.cpp b/test/benchmarks/lexer.cpp
index 0f3151f..4279d8b 100644
--- a/test/benchmarks/lexer.cpp
+++ b/test/benchmarks/lexer.cpp
@@ -15,11 +15,20 @@ protected:
};
};
-BENCHMARK_F(SelectionOfNumbers, ParseStdRegex)(benchmark::State &state) {
+BENCHMARK_F(SelectionOfNumbers, ParseStdRegex)(benchmark::State& state) {
using namespace math::server::lexer::details;
for (auto _ : state) {
for (const auto& src : m_numbers) {
- parse_number(src);
+ impl::std_parse_number(src);
+ }
+ }
+}
+
+BENCHMARK_F(SelectionOfNumbers, ParseBoostRegex)(benchmark::State& state) {
+ using namespace math::server::lexer::details;
+ for (auto _ : state) {
+ for (const auto& src : m_numbers) {
+ impl::boost_parse_number(src);
}
}
}