mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
7f052a7213
commit
fd3b0dec4a
4 changed files with 41 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
Mon Oct 15 03:51:46 2012 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* 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 <ko1@atdot.net>
|
||||
|
||||
* vm_eval.c (vm_call0_body): add new function.
|
||||
|
|
14
benchmark/bm_vm1_attr_ivar.rb
Normal file
14
benchmark/bm_vm1_attr_ivar.rb
Normal file
|
@ -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
|
14
benchmark/bm_vm1_attr_ivar_set.rb
Normal file
14
benchmark/bm_vm1_attr_ivar_set.rb
Normal file
|
@ -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
|
7
benchmark/bm_vm1_float_simple.rb
Normal file
7
benchmark/bm_vm1_float_simple.rb
Normal file
|
@ -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
|
Loading…
Reference in a new issue