Skip to content

Commit 68e1f7d

Browse files
committed
Add ractor benchmark gvl_release_acquire.rb
Measures time taken to acquire and release the GVL over and over. Right now it's quite a large overhead when we have a few ractors.
1 parent d7ac537 commit 68e1f7d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require_relative "../../harness/loader"
2+
3+
run_benchmark(5) do |num_rs, ractor_args|
4+
output = File.open("/dev/null", "wb")
5+
input = File.open("/dev/zero", "rb")
6+
100_000.times do
7+
output.write(input.read(10))
8+
end
9+
end

0 commit comments

Comments
 (0)