Skip to content

Commit bce6aa2

Browse files
committed
Make attr_accessor benchmark compatible with ractors
1 parent 76e8fe8 commit bce6aa2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

benchmarks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ attr_accessor:
139139
desc: attr_accessor tests the performance of getting instance variable values via an attr_accessor imemo.
140140
category: micro
141141
single_file: true
142+
ractor: true
142143
keyword_args:
143144
desc: keyword_args tests the performance of method calls with keyword arguments.
144145
category: micro

benchmarks/attr_accessor.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ def get_value_loop
3434
end
3535
end
3636

37-
obj = TheClass.new
37+
OBJ = TheClass.new
38+
Ractor.make_shareable(OBJ)
3839

39-
run_benchmark(850) do
40-
obj.get_value_loop
40+
run_benchmark(10) do
41+
OBJ.get_value_loop
4142
end

0 commit comments

Comments
 (0)