Skip to content

Commit d501106

Browse files
committed
Tweak setivar to work both with or without ractors
1 parent aeac4a3 commit d501106

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

benchmarks/setivar.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ def set_value_loop
3030

3131
obj = TheClass.new
3232

33-
run_benchmark(1000) do
34-
obj.set_value_loop
33+
if ENV["YJIT_BENCH_RACTOR_HARNESS"]
34+
# same code as below, just pass obj as a ractor arg
35+
run_benchmark(1000, ractor_args: [obj]) do |_, object|
36+
object.set_value_loop
37+
end
38+
else
39+
run_benchmark(1000) do
40+
obj.set_value_loop
41+
end
3542
end

0 commit comments

Comments
 (0)