From d7581370fd7cef8743c317a1a119215cf064bb73 Mon Sep 17 00:00:00 2001 From: Aaron Patterson 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 --- benchmark/vm_ivar_set_subclass.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 benchmark/vm_ivar_set_subclass.yml diff --git a/benchmark/vm_ivar_set_subclass.yml b/benchmark/vm_ivar_set_subclass.yml new file mode 100644 index 0000000000..2fa995386d --- /dev/null +++ b/benchmark/vm_ivar_set_subclass.yml @@ -0,0 +1,17 @@ +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 v1.2.3