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