Add IO write throughput/locking overhead benchmark.

This commit is contained in:
Samuel Williams committed 2022-05-28 15:44:18 +12:00
1 parent 15ebfe2849
commit 216593f59b
1 file changed
+22
Notes: git 2022-05-28 12:44:47 +09:00
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env ruby
require 'benchmark'
i, o = IO.pipe
o.sync = true
DOT = ".".freeze
chunks = 100_000.times.collect{DOT}
thread = Thread.new do
while i.read(1024)
end
end
100.times do
o.write(*chunks)
end
o.close
thread.join