summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog6
-rw-r--r--benchmark/bm_vm1_attr_ivar.rb14
-rw-r--r--benchmark/bm_vm1_attr_ivar_set.rb14
-rw-r--r--benchmark/bm_vm1_float_simple.rb7
4 files changed, 41 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d0e4af9..8f324d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
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
diff --git a/benchmark/bm_vm1_attr_ivar_set.rb b/benchmark/bm_vm1_attr_ivar_set.rb
new file mode 100644
index 0000000..410b62c
--- /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 0000000..46e3f2a
--- /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