Skip to content
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

Call gsub with a Regexp instead of a String for better performance #17483

Merged
merged 1 commit into from Nov 2, 2014

Conversation

pabloh
Copy link
Contributor

@pabloh pabloh commented Nov 1, 2014

Benchmarks are here: #17308

@sgrif
Copy link
Contributor

sgrif commented Nov 2, 2014

Nice. Looks like there's still a few more places we're calling gsub with a string left. Would you mind grepping the code base and including them all in this commit?

@pabloh
Copy link
Contributor Author

pabloh commented Nov 2, 2014

Nice. Looks like there's still a few more places we're calling gsub with a string left. Would you mind grepping the code base and including them all in this commit?

I saw a few others, but since they weren't at very commonly executed method I didn't include them. For instance there are quite a few on tests.
Do do think they are all worth including?, also the ones on tests?.

@sgrif
Copy link
Contributor

sgrif commented Nov 2, 2014

In that case, this is fine. Thanks!

sgrif added a commit that referenced this pull request Nov 2, 2014
Call gsub with a Regexp instead of a String for better performance
@sgrif sgrif merged commit 8b611b7 into rails:master Nov 2, 2014
@pabloh pabloh deleted the optimize_gsub_calls branch November 2, 2014 00:54
@pabloh
Copy link
Contributor Author

pabloh commented Nov 2, 2014

In that case, this is fine. Thanks!

No problem!

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.

None yet

2 participants