-
Notifications
You must be signed in to change notification settings - Fork 215
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
Port boost::regex as regex search engine. #722
Conversation
Notepad++'s GPL code can't be used here. |
They should be the same function as these 2 classes. |
861ca6a
to
31bfe46
Compare
The regex code to find words in current document is actually much slow than plain find. the removal makes it possible to use external regex engine.
The experimental regex syntax (3~6 times slow than plain find) is removed by 631662f. we can use It's maybe better to exam/compare other regex libraries for small dependents, small binary, etc. |
PCRE2 or google RE2? PCRE2's library seems to be slightly lighter and faster, RE2 is fastest among these libs but may lack in functionality. |
Not sure. there are others listed on https://handwiki.org/wiki/Software:Comparison_of_regular_expression_engines |
I've seen a post in zhihu and boost's benchmark data. They all shows that the std::regex implementation is very slow. Oniguruma maybe slower compared to boost::regex. I used it before in EmEditor but it uses the old version. |
with
|
okay,in additional there's a vc project for PCRE2. But I have no enough time in weekdays to apply it to another branch and test them. |
integrate other engines are more complicated, most of them only support (UTF-8 encoded) string parameter instead of custom iterator. |
Related change for speed: https://sourceforge.net/p/scintilla/feature-requests/1500/ |
9fba4a5
to
207db1a
Compare
There's a bug for find previous match, as it always finds next match and keep finding it in that place. The std::regex related code may have the same issue. |
98b8040
to
e188f5d
Compare
…ex engine, PR #722. Also make it possible to build with only `std::regex` when `SCI_OWNREGEX` is defined.
@atauzki can you rebase the code on main and change const int maxTag = std::min(static_cast<int>(match.size()), RESearch::MAXTAG);
for (int co = 0; co < maxTag; co++) {
search.bopat[co] = match[co].first.Pos();
search.eopat[co] = match[co].second.PosRoundUp();
} |
e188f5d
to
034663a
Compare
reverse search bugs that still exists:
and forward search bug: the |
071465e
to
363d6b8
Compare
363d6b8
to
4b4a26e
Compare
It seems more work is required to make it usable, the speed is slow than expected, |
This is a rebased commit.
4b4a26e
to
11a4cbd
Compare
The |
Basic version (synced from |
code are mainly from other open souce projects. Tested by mingwg-cc and clang-msvc.
but there is a problem compiling with MSVC, with the calling convention __vectorcall is not compatible with boost::regex.