4 ms·
std::regex has such horrible performance that it's probably better not to use it even in C++.
by qalmakka 2y ago
std::regex has such horrible performance that it's probably better not to use it even in C++.
- jcelerier 2y agoentirely. Good alternatives are CTRE (https://github.com/hanickadot/compile-time-regular-expressions https://github.com/hanickadot/compile-time-regular-expressio...) which parses the regex and instantiates the automaton entirely at compile-time, or Google's re2 (https://github.com/google/re2 https://github.com/google/re2) if you need to generate regular expressions at run-time. Even boost.regex on which std::regex is originally based, performs better because they can afford to break ABI.