summaryrefslogtreecommitdiff
path: root/benchmark/bm_vm1_attr_ivar.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-14 18:53:01 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-14 18:53:01 +0000
commitfd3b0dec4a4aa0e56bf56bb058688e0dea91c090 (patch)
tree835dbbb454a3d7eeac23d68f7d57d8824f9770a5 /benchmark/bm_vm1_attr_ivar.rb
parent7f052a7213e21c800fa4bd80f61e7903804bcf4f (diff)
* 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
Diffstat (limited to 'benchmark/bm_vm1_attr_ivar.rb')
-rw-r--r--benchmark/bm_vm1_attr_ivar.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/benchmark/bm_vm1_attr_ivar.rb b/benchmark/bm_vm1_attr_ivar.rb
new file mode 100644
index 0000000..6c39e20
--- /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