-
Notifications
You must be signed in to change notification settings - Fork 89
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
Regex optimizations #940
Comments
@pierce314159 particularly interested in your opinion on the "Can we simplify |
yeah I think this should work! @glitch and I talked about something similar when I was first implementing the substring search methods, but I stayed away from it at first because I was unsure how to handle cases where |
@pierce314159 @glitch I'm updating issues that were impacted by the 1.25.1 upgrade. Any new thoughts on simplifying |
yeah I think this is a good idea! I'll see if I can get a PR for this up today |
… to only use Regex.search
…se Regex.search (#1030) Co-authored-by: Pierce Hayes <pierce314159@users.noreply.github.com>
Most of the core regex operations have been heavily optimized. The last remaining cases that I know of are peel/stick, but I believe the next step there is converting them to aggregation which I captured into a new and more specific issue -- #1039 |
While working on #917 and #930 I came up with some regular expression optimizations and simplifications I wanted to capture.
createStringWith*Buffer
to skip utf8-validation (offline I believer we decided utf8 is required, and in Chapel the code that validates utf-8 also calculates the number of codepoints, so skipping validation really doesn't save any time. I also don't believe this is particularly slow anyways.)var matches = myRegex.matches(...)
allocates an array to store the result into, which adds unnecessary overhead. I wonder if we can switch the current uses to just iterate instead of capturing.contains
/startsWith
/endsWith
/match
? Today each operation is implemented pretty differently (and theendsWith
implementation ends up being slower because it captures an iterator into an array.) I think we can instead only implementsearch
on the server side and have the client add the appropriate^
and$
markers. e.g.unorderedCopy
, which will be slow on networks with slow small messages ratesThe text was updated successfully, but these errors were encountered: