[#80531] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...>
SASADA Koichi <ko1@ruby-lang.org> wrote:
On 2017/04/02 11:35, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
Eric Wong <normalperson@yhbt.net> wrote:
On 2017/05/08 9:33, Eric Wong wrote:
On 2017/05/08 10:53, SASADA Koichi wrote:
SASADA Koichi <ko1@atdot.net> wrote:
On 2017/05/08 12:01, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
On 2017/05/08 15:36, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
On 2017/05/09 12:38, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
On 2017/05/09 14:12, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
On 2017/05/09 15:23, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
Thank you.
[#80763] [Ruby trunk Feature#13434] better method definition in C API — naruse@...
Issue #13434 has been updated by naruse (Yui NARUSE).
[#80844] [Ruby trunk Bug#13503] Improve performance of some Time & Rational methods — watson1978@...
Issue #13503 has been updated by watson1978 (Shizuo Fujita).
[#80892] [Ruby trunk Misc#13514] [PATCH] thread_pthread.c (native_sleep): preserve old unblock function — ko1@...
Issue #13514 has been updated by ko1 (Koichi Sasada).
ko1@atdot.net wrote:
On 2017/04/27 8:58, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
Eric Wong <normalperson@yhbt.net> wrote:
[ruby-core:80915] [Ruby trunk Bug#13519] Improve performance of some Time methods
Issue #13519 has been reported by watson1978 (Shizuo Fujita).
----------------------------------------
Bug #13519: Improve performance of some Time methods
https://bugs.ruby-lang.org/issues/13519
* 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 related to https://bugs.ruby-lang.org/issues/13503
Some Time methods will call internal quov() function and
quov() calls Numeric#quo -> Rational#quo -> ...
This patch will add rb_numeric_quo() as internal C API to call Numeric#quo directly.
And this will use rb_numeric_quo() instead of rb_funcall() for Numeric#quo to internal objects.
Time#- will be faster around 15%.
### Before
~~~
Calculating -------------------------------------
Time#subsec 2.029M (賊 8.6%) i/s - 10.078M in 5.003036s
Time#- 4.225M (賊 2.1%) i/s - 21.130M in 5.003600s
Time#to_f 5.580M (賊 2.1%) i/s - 27.955M in 5.011881s
Time#to_r 1.862M (賊 9.8%) i/s - 9.253M in 5.016749s
~~~
### After
~~~
Calculating -------------------------------------
Time#subsec 2.196M (賊10.7%) i/s - 10.879M in 5.010285s
Time#- 4.991M (賊 2.2%) i/s - 24.966M in 5.005041s
Time#to_f 6.809M (賊13.5%) i/s - 32.204M in 5.005536s
Time#to_r 1.980M (賊 9.6%) i/s - 9.854M in 5.020879s
~~~
### Test code
~~~
require 'benchmark/ips'
Benchmark.ips do |x|
x.report "Time#subsec" do |t|
time = Time.now
t.times { time.subsec }
end
x.report "Time#-" do |t|
time1 = Time.now
time2 = Time.now
t.times { time1 - time2 }
end
x.report "Time#to_f" do |t|
time = Time.now
t.times { time.to_f }
end
x.report "Time#to_r" do |t|
time = Time.now
t.times { time.to_r }
end
end
~~~
### Patch
https://github.com/ruby/ruby/pull/1601
--
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>