ruby-changes:72951
From: Jemma <ko1@a...>
Date: Thu, 18 Aug 2022 02:26:41 +0900 (JST)
Subject: [ruby-changes:72951] b4539dba7a (master): Added vm setivar benchmark from yjit-bench
https://git.ruby-lang.org/ruby.git/commit/?id=b4539dba7a From b4539dba7ae85de192b6d0114e3edf70a4cf6ae6 Mon Sep 17 00:00:00 2001 From: Jemma Issroff <jemmaissroff@g...> Date: Wed, 17 Aug 2022 13:24:50 -0400 Subject: Added vm setivar benchmark from yjit-bench --- benchmark/vm_ivar_set_on_instance.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 benchmark/vm_ivar_set_on_instance.yml diff --git a/benchmark/vm_ivar_set_on_instance.yml b/benchmark/vm_ivar_set_on_instance.yml new file mode 100644 index 0000000000..f0d5c16964 --- /dev/null +++ b/benchmark/vm_ivar_set_on_instance.yml @@ -0,0 +1,35 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm_ivar_set_on_instance.yml#L1 +prelude: | + class TheClass + def initialize + @v0 = 1 + @v1 = 2 + @v3 = 3 + @levar = 1 + end + + def set_value_loop + # 1M + i = 0 + while i < 1000000 + # 10 times to de-emphasize loop overhead + @levar = i + @levar = i + @levar = i + @levar = i + @levar = i + @levar = i + @levar = i + @levar = i + @levar = i + @levar = i + i += 1 + end + end + end + + obj = TheClass.new + +benchmark: + vm_ivar_set_on_instance: | + obj.set_value_loop +loop_count: 100 -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/