Closed mojavelinux closed 1 year ago
Is there anything I need to do to get this PR accepted?
Done.
I ran the tests on 2.2.0 since that's what the README says is being used, but the performance is even more noticable using Ruby 3.2.1.
Comparison:
String#delete (const): 7168876.7 i/s
String#delete: 6308819.2 i/s - 1.14x slower
String#tr: 5156099.1 i/s - 1.39x slower
String#gsub: 1337592.2 i/s - 5.36x slower
This benchmark proves that delete is faster than tr and both are considerably faster than gsub when removing a character from a string.