Hi all.
What do you think about this changes https://github.com/rails/rails/compare/master…lvl0nax:am_refactoring?expand=1
Benchmark points
- gsub => chomp
str = ‘some_test’
Benchmark.ips do |x|
x.report(“chomp”) { str.chomp(‘_test’) }
x.report(“gsub”) { str.gsub(/_test$/, ‘’) }
x.compare!
end
Calculating -------------------------------------
chomp 135.882k i/100ms
gsub 39.913k i/100ms