summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--benchmark/bm_io_select2.rb2
-rw-r--r--benchmark/bm_io_select3.rb17
3 files changed, 22 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9c2c61022e..2168610e53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat Apr 30 16:48:36 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * benchmark/bm_io_select3.rb: New.
+
Sat Apr 30 16:27:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* io.c (copy_stream_body, rb_io_s_copy_stream): move rb_fd_init()
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
+