summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/bm_io_select2.rb2
-rw-r--r--benchmark/bm_io_select3.rb17
2 files changed, 18 insertions, 1 deletions
diff --git a/benchmark/bm_io_select2.rb b/benchmark/bm_io_select2.rb
index b48651349e..a4925b5100 100644
--- a/benchmark/bm_io_select2.rb
+++ b/benchmark/bm_io_select2.rb
@@ -1,4 +1,4 @@
-# IO.select performance. worst case
+# IO.select performance. worst case of single fd.
ios = []
nr = 1000000
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
+