mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* benchmark/bm_io_select3.rb: New.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
98c7ca9b65
commit
5201602c27
3 changed files with 22 additions and 1 deletions
|
@ -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()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# IO.select performance. worst case
|
||||
# IO.select performance. worst case of single fd.
|
||||
|
||||
ios = []
|
||||
nr = 1000000
|
||||
|
|
17
benchmark/bm_io_select3.rb
Normal file
17
benchmark/bm_io_select3.rb
Normal file
|
@ -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
|
||||
|
Loading…
Add table
Reference in a new issue