From 8561baf3407ec1ac2a2660143df2355da0be1326 Mon Sep 17 00:00:00 2001 From: mrkn Date: Fri, 14 Apr 2017 05:19:12 +0000 Subject: Improve performance of type conversion using to_r * object.c: Add to_r in conv_method_tbl. * defs/id.def: add to_r. * benchmark/bm_int_quo.rb: added. * benchmark/bm_time_subsec.rb: added. [Bug #13426] [ruby-core:80665] [Fix GH-1582] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- benchmark/bm_int_quo.rb | 1 + benchmark/bm_time_subsec.rb | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 benchmark/bm_int_quo.rb create mode 100644 benchmark/bm_time_subsec.rb (limited to 'benchmark') diff --git a/benchmark/bm_int_quo.rb b/benchmark/bm_int_quo.rb new file mode 100644 index 0000000000..e22a3f8c30 --- /dev/null +++ b/benchmark/bm_int_quo.rb @@ -0,0 +1 @@ +5000000.times { 42.quo(3) } diff --git a/benchmark/bm_time_subsec.rb b/benchmark/bm_time_subsec.rb new file mode 100644 index 0000000000..505021c701 --- /dev/null +++ b/benchmark/bm_time_subsec.rb @@ -0,0 +1,2 @@ +t = Time.now +4000000.times { t.subsec } -- cgit v1.2.3