Add benchmarks for setting / getting ivars on generics

This commit is contained in:
Jemma Issroff authored and Aaron Patterson committed 2022-07-15 13:39:02 -07:00
1 parent aed1539ec5
commit f375280d5a
2 files changed
+31
Notes: git 2022-07-16 05:39:23 +09:00

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
prelude: |
class C < Array
attr_reader :a, :b, :c
def initialize
@a = nil
@b = nil
@c = nil
end
end
c = C.new
benchmark:
vm_ivar_generic_get: |
c.a
c.b
c.c
loop_count: 30000000
+14
View File
@@ -0,0 +1,14 @@
prelude: |
class C < Array
def set_ivars
@a = nil
@b = nil
@c = nil
end
end
c = C.new
benchmark:
vm_ivar_generic_set: |
c.set_ivars
loop_count: 30000000