[#80974] [Ruby trunk Feature#13517] [PATCH] reduce rb_mutex_t size from 160 to 80 bytes on 64-bit — ko1@...
Issue #13517 has been updated by ko1 (Koichi Sasada).
4 messages
2017/05/02
[#81024] Re: [Ruby trunk Feature#13517] [PATCH] reduce rb_mutex_t size from 160 to 80 bytes on 64-bit
— SASADA Koichi <ko1@...>
2017/05/07
sorry for late response.
[#80996] [Ruby trunk Feature#13544] Allow loading an ISeqs sequence directly from a C extension without requiring buffer is in an RVALUE — sam.saffron@...
Issue #13544 has been reported by sam.saffron (Sam Saffron).
3 messages
2017/05/04
[#81016] [Ruby trunk Bug#13526] Segmentation fault at 0x0055c2e58e8920 ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] — s.wanabe@...
Issue #13526 has been updated by wanabe (_ wanabe).
3 messages
2017/05/07
[#81048] Re: [ruby-cvs:65788] normal:r58614 (trunk): rb_execution_context_t: move stack, stack_size and cfp from rb_thread_t — SASADA Koichi <ko1@...>
It causes compile error on raspi 3.
3 messages
2017/05/09
[#81201] Re: [ruby-cvs:65935] normal:r58761 (trunk): test/test_extilibs.rb: do not check the existence of fiddle — "U.NAKAMURA" <usa@...>
Hi, Eric
4 messages
2017/05/16
[#81202] Re: [ruby-cvs:65935] normal:r58761 (trunk): test/test_extilibs.rb: do not check the existence of fiddle
— Eric Wong <normalperson@...>
2017/05/16
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[#81427] Fwd: [ruby-changes:46809] normal:r58924 (trunk): test for IO.copy_stream CPU usage (r58534) — SASADA Koichi <ko1@...>
Hi,
6 messages
2017/05/28
[#81428] Re: Fwd: [ruby-changes:46809] normal:r58924 (trunk): test for IO.copy_stream CPU usage (r58534)
— Eric Wong <normalperson@...>
2017/05/28
SASADA Koichi <ko1@atdot.net> wrote:
[ruby-core:81082] [Ruby trunk Bug#13553] Improve performance in where push the element into non shared Array object
From:
watson1978@...
Date:
2017-05-10 02:38:18 UTC
List:
ruby-core #81082
Issue #13553 has been reported by watson1978 (Shizuo Fujita).
----------------------------------------
Bug #13553: Improve performance in where push the element into non shared Array object
https://bugs.ruby-lang.org/issues/13553
* Author: watson1978 (Shizuo Fujita)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v:
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
rb_ary_modify() has the codes for shared Array object.
In here, it has condition branch for shared / non shared Array object and
it can use rb_ary_modify_check() which is smaller function than rb_ary_modify()
for non shared object.
rb_ary_modify_check() will be expand as inline function.
If it will compile with GCC, Array#<< will be faster around 8%.
## Clang 802.0.42
### Before
~~~
Calculating -------------------------------------
Array#<< 9.353M (賊 1.7%) i/s - 46.787M in 5.004123s
Array#push 7.702M (賊 1.1%) i/s - 38.577M in 5.009338s
Array#values_at 6.133M (賊 1.9%) i/s - 30.699M in 5.007772s
~~~
### After
~~~
Calculating -------------------------------------
Array#<< 9.458M (賊 2.0%) i/s - 47.357M in 5.009069s
Array#push 7.921M (賊 1.8%) i/s - 39.665M in 5.009151s
Array#values_at 6.377M (賊 2.3%) i/s - 31.881M in 5.001888s
~~~
### Result
~~~
Array#<< -> 1.2% faster
Array#push -> 2.8% faster
Array#values_at -> 3.9% faster
~~~
## GCC 7.1.0
### Before
~~~
Calculating -------------------------------------
Array#<< 10.497M (賊 1.1%) i/s - 52.665M in 5.017601s
Array#push 8.527M (賊 1.6%) i/s - 42.777M in 5.018003s
Array#values_at 7.621M (賊 1.7%) i/s - 38.152M in 5.007910s
~~~
### After
~~~
Calculating -------------------------------------
Array#<< 11.403M (賊 1.3%) i/s - 57.028M in 5.001849s
Array#push 8.924M (賊 1.3%) i/s - 44.609M in 4.999940s
Array#values_at 8.291M (賊 1.4%) i/s - 41.487M in 5.004727s
~~~
### Result
~~~
Array#<< -> 8.3% faster
Array#push -> 4.3% faster
Array#values_at -> 8.7% faster
~~~
## Test code
~~~
require 'benchmark/ips'
Benchmark.ips do |x|
x.report "Array#<<" do |i|
i.times { [1,2] << 3 }
end
x.report "Array#push" do |i|
i.times { [1,2].push(3) }
end
x.report "Array#values_at" do |i|
ary = [1, 2, 3, 4, 5]
i.times { ary.values_at(0, 2, 4) }
end
end
~~~
## Patch
https://github.com/ruby/ruby/pull/1609
--
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>