[前][次][番号順一覧][スレッド一覧]

ruby-changes:19350

From: kosaki <ko1@a...>
Date: Sat, 30 Apr 2011 16:16:39 +0900 (JST)
Subject: [ruby-changes:19350] Ruby:r31390 (trunk): * benchmark/bm_io_select.rb, benchmark/bm_io_select2.rb: New.

kosaki	2011-04-30 16:16:31 +0900 (Sat, 30 Apr 2011)

  New Revision: 31390

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31390

  Log:
    * benchmark/bm_io_select.rb, benchmark/bm_io_select2.rb: New.
      based on a patch from Eric Wong at [Feature #4531]

  Added files:
    trunk/benchmark/bm_io_select.rb
    trunk/benchmark/bm_io_select2.rb
  Modified files:
    trunk/ChangeLog

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31389)
+++ ChangeLog	(revision 31390)
@@ -1,3 +1,8 @@
+Sat Apr 30 16:13:17 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* benchmark/bm_io_select.rb, benchmark/bm_io_select2.rb: New.
+	  based on a patch from Eric Wong at [Feature #4531]
+
 Sat Apr 30 03:25:53 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* test/io/wait/test_io_wait.rb: New. for testing ext/io/wait.
Index: benchmark/bm_io_select.rb
===================================================================
--- benchmark/bm_io_select.rb	(revision 0)
+++ benchmark/bm_io_select.rb	(revision 31390)
@@ -0,0 +1,9 @@
+# IO.select performance
+
+w = [ IO.pipe[1] ];
+
+nr = 1000000
+nr.times {
+  IO.select nil, w
+}
+

Property changes on: benchmark/bm_io_select.rb
___________________________________________________________________
Added: svn:eol-style
   + LF

Index: benchmark/bm_io_select2.rb
===================================================================
--- benchmark/bm_io_select2.rb	(revision 0)
+++ benchmark/bm_io_select2.rb	(revision 31390)
@@ -0,0 +1,18 @@
+# IO.select performance. worst case
+
+ios = []
+nr = 1000000
+max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+puts "max fd: #{max} (results not apparent with <= 1024 max fd)"
+
+((max / 2) - 2).times do
+  ios.concat IO.pipe
+end
+
+last = [ ios[-1] ]
+puts "last IO: #{last[0].inspect}"
+
+nr.times do
+  IO.select nil, last
+end
+

Property changes on: benchmark/bm_io_select2.rb
___________________________________________________________________
Added: svn:eol-style
   + LF


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]