mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
d7581370fd
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
17 lines
236 B
YAML
17 lines
236 B
YAML
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
|