Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Regex class by std::regex #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

d3m3t3r
Copy link
Contributor

@d3m3t3r d3m3t3r commented Aug 12, 2024

C++11 introduced a standard implementation for regular expressions std::regex which can easily replace Regex class.

@i-ky
Copy link
Owner

i-ky commented Aug 13, 2024

Hi @d3m3t3r!

Thank you for the suggestion. Looks very neat! Throwing away 50 lines of code must feel nice. 😃

However, there are rumors that std::regex is unbelievably slow, see:

  1. https://stackoverflow.com/questions/70583395/why-is-stdregex-notoriously-much-slower-than-other-regular-expression-librarie
  2. https://stackoverflow.com/questions/20942450/why-c11-regex-libc-implementation-is-so-slow
  3. https://www.reddit.com/r/cpp_questions/comments/yzqgm6/regex_is_comically_slow_high_performance/
  4. include-what-you-use/include-what-you-use@cf53880

I haven't done my own research, but I don't have reasons to believe that the above benchmarks are wrong. That's why I went with good old <regex.h>.

Do you have hands on experience with std::regex? Can you say any good words about its performance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants