mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Added vm setivar benchmark from yjit-bench
This commit is contained in:
parent
b4daf6e28e
commit
b4539dba7a
Notes:
git
2022-08-18 02:26:53 +09:00
1 changed files with 35 additions and 0 deletions
35
benchmark/vm_ivar_set_on_instance.yml
Normal file
35
benchmark/vm_ivar_set_on_instance.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
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
|
Loading…
Add table
Reference in a new issue