1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix style on vm_ivar benchmarks (#6379)

This commit is contained in:
Jemma Issroff 2022-09-14 20:39:39 -04:00 committed by GitHub
parent 752ae81ed1
commit aecb57ceb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2022-09-15 09:40:05 +09:00
Merged-By: k0kubun <takashikkbn@gmail.com>
3 changed files with 28 additions and 28 deletions

View file

@ -1,33 +1,33 @@
prelude: |
class Example
def initialize
@v0 = 1
@v1 = 2
@v3 = 3
@levar = 1
def initialize
@v0 = 1
@v1 = 2
@v3 = 3
@levar = 1
end
def get_value_loop
sum = 0
i = 0
while i < 1000000
# 10 times to de-emphasize loop overhead
sum += @levar
sum += @levar
sum += @levar
sum += @levar
sum += @levar
sum += @levar
sum += @levar
sum += @levar
sum += @levar
sum += @levar
i += 1
end
def get_value_loop
sum = 0
i = 0
while i < 1000000
# 10 times to de-emphasize loop overhead
sum += @levar
sum += @levar
sum += @levar
sum += @levar
sum += @levar
sum += @levar
sum += @levar
sum += @levar
sum += @levar
sum += @levar
i += 1
end
return sum
end
return sum
end
end
obj = Example.new

View file

@ -1,5 +1,5 @@
prelude: |
class Example
class Example
def read
@uninitialized
end

View file

@ -1,5 +1,5 @@
prelude: |
class Example
class Example
def lazy_set
@uninitialized ||= 123
end