aboutsummaryrefslogtreecommitdiffstats
path: root/benchmark/bm_io_select3.rb
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/bm_io_select3.rb
parent98c7ca9b65be4bc102463d1c90142094e8d05c42 (diff)
downloadruby-5201602c276115ae4be8442d73c567c95af22f7b.tar.gz
* 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/bm_io_select3.rb')
-rw-r--r--benchmark/bm_io_select3.rb17
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
+