Skip to content

Commit

Permalink
Add a benchmark for polymorphic ivar setting
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tenderlove committed Nov 9, 2020
1 parent 4219cb7 commit d758137
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 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

0 comments on commit d758137

Please sign in to comment.