diff options
Diffstat (limited to 'benchmark/bm_io_select3.rb')
-rw-r--r-- | benchmark/bm_io_select3.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/benchmark/bm_io_select3.rb b/benchmark/bm_io_select3.rb new file mode 100644 index 0000000000..fcdbb96e0e --- /dev/null +++ b/benchmark/bm_io_select3.rb @@ -0,0 +1,17 @@ +# IO.select performance. a lot of fd + +ios = [] +nr = 100 +max = Process.getrlimit(Process::RLIMIT_NOFILE)[0] +puts "max fd: #{max} (results not apparent with <= 1024 max fd)" + +(max - 10).times do + r, w = IO.pipe + r.close + ios.push w +end + +nr.times do + IO.select nil, ios +end + |