-
Notifications
You must be signed in to change notification settings - Fork 45
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
Excessive String Creation #58
Labels
Comments
Interesting use case. Returning a stream definitely makes sense for large amount of matches. I'll take a stab at implementing it. Will actually need this soon. too. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using the SOM_LEFTMOST expression flag, all matching strings are returned within the returned list of match objects. For large strings (1+MB) and certain regexps this could cause orders of magnitude more strings to be created. If the scan method could return these strings as a lazy collection such as a Stream instead of a List, this could avoid consuming too much heap memory via the string pool. Alternatively, just the start and end offsets could be returned so the caller can control the number of strings created.
The text was updated successfully, but these errors were encountered: