From fd3b0dec4a4aa0e56bf56bb058688e0dea91c090 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 14 Oct 2012 18:53:01 +0000 Subject: * benchmark/bm_vm1_attr_ivar(_set).rb: added (for method dispatch speed). * benchmark/bm_vm1_float_simple.rb: added (for flonum/float). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ benchmark/bm_vm1_attr_ivar.rb | 14 ++++++++++++++ benchmark/bm_vm1_attr_ivar_set.rb | 14 ++++++++++++++ benchmark/bm_vm1_float_simple.rb | 7 +++++++ 4 files changed, 41 insertions(+) create mode 100644 benchmark/bm_vm1_attr_ivar.rb create mode 100644 benchmark/bm_vm1_attr_ivar_set.rb create mode 100644 benchmark/bm_vm1_float_simple.rb diff --git a/ChangeLog b/ChangeLog index d0e4af9566..8f324d34f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Oct 15 03:51:46 2012 Koichi Sasada + + * benchmark/bm_vm1_attr_ivar(_set).rb: added (for method dispatch speed). + + * benchmark/bm_vm1_float_simple.rb: added (for flonum/float). + Mon Oct 15 02:51:16 2012 Koichi Sasada * vm_eval.c (vm_call0_body): add new function. diff --git a/benchmark/bm_vm1_attr_ivar.rb b/benchmark/bm_vm1_attr_ivar.rb new file mode 100644 index 0000000000..6c39e20564 --- /dev/null +++ b/benchmark/bm_vm1_attr_ivar.rb @@ -0,0 +1,14 @@ +class C + attr_reader :a, :b + def initialize + @a = nil + @b = nil + end +end +obj = C.new +i = 0 +while i<30_000_000 # while loop 1 + i+= 1 + j = obj.a + k = obj.b +end diff --git a/benchmark/bm_vm1_attr_ivar_set.rb b/benchmark/bm_vm1_attr_ivar_set.rb new file mode 100644 index 0000000000..410b62c6a4 --- /dev/null +++ b/benchmark/bm_vm1_attr_ivar_set.rb @@ -0,0 +1,14 @@ +class C + attr_accessor :a, :b + def initialize + @a = nil + @b = nil + end +end +obj = C.new +i = 0 +while i<30_000_000 # while loop 1 + i+= 1 + obj.a = 1 + obj.b = 2 +end diff --git a/benchmark/bm_vm1_float_simple.rb b/benchmark/bm_vm1_float_simple.rb new file mode 100644 index 0000000000..46e3f2aaed --- /dev/null +++ b/benchmark/bm_vm1_float_simple.rb @@ -0,0 +1,7 @@ +i= 0.0; f = 0.0 +while i<30_000_000 + i+= 1 + f += 0.1; f -= 0.1 + f += 0.1; f -= 0.1 + f += 0.1; f -= 0.1 +end -- cgit v1.2.3