From f25b3c005e3ba1153f319a07effbec232e8c9eed Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 11 Mar 2024 20:52:56 +1100 Subject: [PATCH] flatten ThreadedRegexVM::codepoint Profiling shows that this does not always get the utf8::read_codepoint call inlined and that almost doubles the time spent in the function. --- src/regex_impl.hh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/regex_impl.hh b/src/regex_impl.hh index 1e8296b53..43db9a024 100644 --- a/src/regex_impl.hh +++ b/src/regex_impl.hh @@ -618,6 +618,7 @@ private: is_word(utf8::codepoint(pos, config.subject_end)); } + [[gnu::flatten]] static Codepoint codepoint(Iterator& it, const ExecConfig& config) { if constexpr (forward)