[前][次][番号順一覧][スレッド一覧]

ruby-changes:63564

From: Aaron <ko1@a...>
Date: Tue, 10 Nov 2020 07:06:03 +0900 (JST)
Subject: [ruby-changes:63564] d7581370fd (master): Add a benchmark for polymorphic ivar setting

https://git.ruby-lang.org/ruby.git/commit/?id=d7581370fd

From d7581370fd7cef8743c317a1a119215cf064bb73 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Mon, 9 Nov 2020 12:02:20 -0800
Subject: Add a benchmark for polymorphic ivar setting

This benchmark demonstrates the performance of setting an instance
variable when the type of object is constantly changing.  This benchmark
should give us an idea of the performance of ivar setting in a
polymorphic environment

diff --git a/benchmark/vm_ivar_set_subclass.yml b/benchmark/vm_ivar_set_subclass.yml
new file mode 100644
index 0000000..2fa9953
--- /dev/null
+++ b/benchmark/vm_ivar_set_subclass.yml
@@ -0,0 +1,17 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm_ivar_set_subclass.yml#L1
+prelude: |
+  class A
+    def initialize
+      @a = nil
+      @b = nil
+      @c = nil
+      @d = nil
+      @e = nil
+    end
+  end
+  class B < A; end
+  class C < A; end
+benchmark:
+  vm_ivar_init: |
+    B.new
+    C.new
+loop_count: 3000000
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]