Patch #29363

Use String#tr instead of String#gsub

Added by Go MAEDA about 1 month ago. Updated about 1 month ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% 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

replace-gsub-with-tr.patch Magnifier (3.86 KB) Go MAEDA, 2018-08-12 06:06

Associated revisions

Revision 17469
Added by Go MAEDA about 1 month ago

Replace String#gsub with faster String#tr (#29363).

Patch by Go MAEDA.

History

#1 Updated by Go MAEDA about 1 month ago

  • Target version set to 4.1.0

#2 Updated by Go MAEDA about 1 month ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed.

#3 Updated by Go MAEDA about 1 month ago

  • Target version changed from 4.1.0 to 4.0.0

Also available in: Atom PDF