summaryrefslogtreecommitdiff
path: root/benchmark/vm_ivar_lazy_set.yml
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/vm_ivar_lazy_set.yml')
-rw-r--r--benchmark/vm_ivar_lazy_set.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/benchmark/vm_ivar_lazy_set.yml b/benchmark/vm_ivar_lazy_set.yml
new file mode 100644
index 0000000000..7372ffcfbc
--- /dev/null
+++ b/benchmark/vm_ivar_lazy_set.yml
@@ -0,0 +1,12 @@
+prelude: |
+ class Example
+ def lazy_set
+ @uninitialized ||= 123
+ end
+ end
+
+ objs = 10000000.times.map { Example.new }
+benchmark:
+ vm_ivar_lazy_set: |
+ objs.each(&:lazy_set)
+loop_count: 1