[#71439] [Ruby trunk - Feature #11339] [PATCH] io.c: avoid kwarg parsing in C API — matz@...
Issue #11339 has been updated by Yukihiro Matsumoto.
7 messages
2015/11/11
[#71473] Re: [Ruby trunk - Feature #11339] [PATCH] io.c: avoid kwarg parsing in C API
— Eric Wong <normalperson@...>
2015/11/13
Entire series for sockets
[#71450] Ruby 2.3.0-preview1 Released — "NARUSE, Yui" <naruse@...>
Hi,
5 messages
2015/11/11
[#71617] [Ruby trunk - Feature #11664] [PATCH] introduce rb_autoload_value to replace rb_autoload — nobu@...
Issue #11664 has been updated by Nobuyoshi Nakada.
3 messages
2015/11/20
[#71721] [Ruby trunk - Feature #11741] Migrate Ruby to Git from Subversion — me@...
Issue #11741 has been updated by Jon Moss.
4 messages
2015/11/28
[ruby-core:71428] [Ruby trunk - Misc #10983] Why blocks make Ruby methods 439% slower ?
From:
nobu@...
Date:
2015-11-10 06:21:17 UTC
List:
ruby-core #71428
Issue #10983 has been updated by Nobuyoshi Nakada.
Description updated
----------------------------------------
Misc #10983: Why blocks make Ruby methods 439% slower ?
https://bugs.ruby-lang.org/issues/10983#change-54797
* Author: Сергей Е
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
https://www.omniref.com/ruby/2.2.0/symbols/Proc/yield#annotation=4087638&line=711&hn=1
~~~ruby
require 'benchmark/ips'
def block_call(&block)
block.call
end
def just_yield
yield
end
Benchmark.ips do |x|
x.report("call") do
block_call { 1 + 1 }
end
x.report("just yield") do
just_yield { 1 + 1 }
end
x.compare!
end
~~~
I run on Ruby 2.2.1
~~~
Calculating -------------------------------------
call 40.754k i/100ms
just yield 69.031k i/100ms
-------------------------------------------------
call 814.929k (± 4.0%) i/s - 4.075M
just yield 2.871M (±25.1%) i/s - 12.909M
Comparison:
just yield: 2871127.3 i/s
call: 814929.3 i/s - 3.52x slower
~~~
--
https://bugs.ruby-lang.org/