Skip to content

Optimize simple regexp split#6237

Closed
headius wants to merge 1 commit intojruby:masterfrom
headius:simple_regexp_split
Closed

Optimize simple regexp split#6237
headius wants to merge 1 commit intojruby:masterfrom
headius:simple_regexp_split

Conversation

@headius
Copy link
Member

@headius headius commented May 21, 2020

This is the same optimization that CRuby 2.7 did for simple regexp in String#split.

This has a tremendous impact on performance of patterns like str.split(/,/) but the code isn't passing all specs yet. Pushing this PR now so we don't lose the code.

Basically just treats simple 7-bit regexps as string or character
splitting.
@headius headius added this to the JRuby 9.3.0.0 milestone May 21, 2020
@headius
Copy link
Member Author

headius commented Jun 26, 2020

The logic I ported over here is fine, but then it drops into older logic that turns a freshly-unwrapped string delimeter back into a regexp and doesn't really save us a great deal. The performance issue for which I explored this (#5857) has also been resolved by making other improvements.

I'm going to ditch this, since it was a 2.7 change anyway and just doing a proper re-port of the split logic would be a better option. Low priority, will refile as a 9.4 item.

@headius headius closed this Jun 26, 2020
@headius headius deleted the simple_regexp_split branch June 26, 2020 19:27
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.

1 participant