lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Solution to std::regex slowness


From: Vadim Zeitlin
Subject: [lmi] Solution to std::regex slowness
Date: Sun, 14 Oct 2018 22:08:42 +0200

 Hello,

 This is not necessarily the most urgent thing to do, but if you remember,
we had to keep using boost::regex instead of switching to std::regex
because the latter was almost unusably slow, unlike the former.

 However I've just learnt about a header-only library which implements
support for compile-time regular expressions:

        https://github.com/hanickadot/compile-time-regular-expressions

It's much faster than std::regex during run-time (no surprise here) but,
amazingly, even seems to be faster than it at compile-time, at least if I
trust the benchmarks from

        
https://github.com/CppCon/CppCon2018/raw/master/Presentations/compile_time_regular_expressions/compile_time_regular_expressions__hana_dusikova__cppcon_2018.pdf

 The main drawback is that this library requires a C++20 compiler (which
don't exist yet) or a C++17 compiler with not (yet?) accepted extension,
which means, in practice, either g++ 7.2+ or clang 5.0+ -- but no MSVS.
However considering that boost::regex is only used in test_coding_rules, I
could live without being able to compile this tool with MSVS if it means
getting rid of boost::regex and also, potentially, speeding it up.

 Of course, I haven't actually tested whether this is going to work, i.e.
we might use some of Perl RE features not supported by this ctre library.
But if you think it could be interesting, I definitely could at least try
to do this, after the other, more urgent, items are dealt with.

 Please let me know,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]