rails/activerecord/lib
brainopia cdac52e124 Prefer string patterns for gsub
https://github.com/ruby/ruby/pull/579 - there is a new optimization
since ruby 2.2

Previously regexp patterns were faster (since a string was converted to
regexp underneath anyway). But now string patterns are faster and
better reflect the purpose.

  Benchmark.ips do |bm|
    bm.report('regexp') { 'this is ::a random string'.gsub(/::/, '/') }
    bm.report('string') { 'this is ::a random string'.gsub('::', '/') }
    bm.compare!
  end
  # string: 753724.4 i/s
  # regexp: 501443.1 i/s - 1.50x slower
2015-04-02 02:07:45 +03:00
..
active_record Prefer string patterns for gsub 2015-04-02 02:07:45 +03:00
rails/generators Add Secure Token Generator 2015-01-11 14:42:54 -05:00
active_record.rb Attempt to provide backwards compatible YAML deserialization 2015-03-10 11:56:45 -06:00