Issue #13447 has been updated by nobu (Nobuyoshi Nakada).


Would you commit it by yourself?

----------------------------------------
Bug #13447: Improve performance of rb_eql()
https://bugs.ruby-lang.org/issues/13447#change-64363

* Author: watson1978 (Shizuo Fujita)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
This is similar with https://github.com/ruby/ruby/pull/1552
At least, Array#eql? will be faster around 30% with following test code.

### Before
~~~
       user     system      total        real
   1.740000   0.000000   1.740000 (  1.738344)
~~~

### After
~~~
       user     system      total        real
   1.300000   0.000000   1.300000 (  1.303624)
~~~

### Test code
~~~
require 'benchmark'

Benchmark.bmbm do |x|
  ary1 = Array.new(1000) { rand(1000) }
  ary2 = Array.new(1000) { rand(1000) }

  x.report do
    5000000.times do
      ary1.eql?(ary2)
    end
  end

end
~~~

### Patch
https://github.com/ruby/ruby/pull/1589




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>