diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2022-09-14 20:39:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-15 09:39:39 +0900 |
commit | aecb57ceb0c690b05ad29a91c418e075342ea84a (patch) | |
tree | 85fa2373dc5e3b17b13a7b8cf1b1c76e33d3845f /benchmark/vm_ivar_get.yml | |
parent | 752ae81ed168444380d265ebefcb3101ef68d890 (diff) | |
download | ruby-aecb57ceb0c690b05ad29a91c418e075342ea84a.tar.gz |
Fix style on vm_ivar benchmarks (#6379)
Diffstat (limited to 'benchmark/vm_ivar_get.yml')
-rw-r--r-- | benchmark/vm_ivar_get.yml | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/benchmark/vm_ivar_get.yml b/benchmark/vm_ivar_get.yml index 8c64ffc77a..9174af6965 100644 --- a/benchmark/vm_ivar_get.yml +++ b/benchmark/vm_ivar_get.yml @@ -1,33 +1,33 @@ prelude: | class Example - def initialize - @v0 = 1 - @v1 = 2 - @v3 = 3 - @levar = 1 - end - - def get_value_loop - sum = 0 + def initialize + @v0 = 1 + @v1 = 2 + @v3 = 3 + @levar = 1 + end - 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 - return sum + 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 end obj = Example.new |