summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-30 07:49:29 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-30 07:49:29 +0000
commit5201602c276115ae4be8442d73c567c95af22f7b (patch)
tree79b78665774dc3c8ae2a8b5ded4c008584afe79b /benchmark
parent98c7ca9b65be4bc102463d1c90142094e8d05c42 (diff)
* benchmark/bm_io_select3.rb: New.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 b486513..a4925b5 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 0000000..fcdbb96
--- /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
+