Patch #29363
Use String#tr instead of String#gsub
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Performance | |||
Target version: | 4.0.0 |
Description
String#tr is more than 3 times faster than String#gsub when replacing a single character in a string with another single character.
https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
Associated revisions
Replace String#gsub with faster String#tr (#29363).
Patch by Go MAEDA.
History
#1
Updated by Go MAEDA almost 4 years ago
- Target version set to 4.1.0
#2
Updated by Go MAEDA almost 4 years ago
- Status changed from New to Closed
- Assignee set to Go MAEDA
Committed.
#3
Updated by Go MAEDA almost 4 years ago
- Target version changed from 4.1.0 to 4.0.0