[#68845] [Ruby trunk - Feature #11056] [PATCH] lib/net/*: use io/wait methods instead of IO.select — normalperson@...
Issue #11056 has been updated by Eric Wong.
3 messages
2015/04/11
[#68945] [Ruby trunk - Feature #11083] [Open] Gemify net-telnet — shibata.hiroshi@...
Issue #11083 has been reported by Hiroshi SHIBATA.
4 messages
2015/04/21
[#68951] Re: [Ruby trunk - Feature #11083] [Open] Gemify net-telnet
— Eric Wong <normalperson@...>
2015/04/21
shibata.hiroshi@gmail.com wrote:
[#69012] [Ruby trunk - Feature #11105] [Open] ES6-like hash literals — shugo@...
Issue #11105 has been reported by Shugo Maeda.
5 messages
2015/04/29
[ruby-core:68835] [Ruby trunk - Feature #11024] [PATCH] connect_nonblock supports "exception: false"
From:
nobu@...
Date:
2015-04-11 01:48:19 UTC
List:
ruby-core #68835
Issue #11024 has been updated by Nobuyoshi Nakada.
Description updated
Seems working fine, but my results don't look better, on Ubuntu 14.10
on VirtualBox on OS X.
nr = 5000 | user | system | total | real
-----------------|----------:|----------:|----------:|-----------:
default | 0.000000 | 0.290000 | 0.290000 |( 0.291610)
exception: false | 0.000000 | 0.210000 | 0.210000 |( 0.218066)
nr = 50000 | user | system | total | real
-----------------|----------:|----------:|----------:|-----------:
default | 0.010000 | 2.840000 | 2.850000 |( 4.859450)
exception: false | 0.020000 | 2.340000 | 2.360000 |( 7.369629)
----------------------------------------
Feature #11024: [PATCH] connect_nonblock supports "exception: false"
https://bugs.ruby-lang.org/issues/11024#change-52099
* Author: Eric Wong
* Status: Open
* Priority: Normal
* Assignee: Nobuyoshi Nakada
----------------------------------------
This is for consistency with accept_nonblock arguments and gives a
minor speedup from avoiding exceptions:
Results:
| user | system | total | real
-----------------|----------:|----------:|----------:|-----------:
default | 0.050000 | 0.100000 | 0.150000 |( 0.151307)
exception: false | 0.030000 | 0.080000 | 0.110000 |( 0.108840)
---------------------------------------------------
~~~ruby
require 'socket'
require 'benchmark'
require 'io/wait'
require 'tmpdir'
host = "127.#{rand 255}.#{rand 255}.#{rand(254) + 1}"
serv = TCPServer.new(host, 0)
nr = 5000
addr = serv.getsockname
pid = fork do
begin
serv.accept.close
rescue => e
warn "#$$: #{e.message} (#{e.class})"
end while true
end
at_exit { Process.kill(:TERM, pid) }
serv.close
Benchmark.bmbm do |x|
x.report("default") do
nr.times do
s = Socket.new(:INET, :STREAM)
s.setsockopt(:SOL_SOCKET, :SO_REUSEADDR, 1)
begin
s.connect_nonblock(addr)
rescue IO::WaitWritable
s.wait_writable
end
s.close
end
end
x.report("exception: false") do
nr.times do
s = Socket.new(:INET, :STREAM)
s.setsockopt(:SOL_SOCKET, :SO_REUSEADDR, 1)
case s.connect_nonblock(addr, exception: false)
when :wait_writable
s.wait_writable
end
s.close
end
end
end
~~~
---Files--------------------------------
0001-connect_nonblock-supports-exception-false.patch (9.14 KB)
--
https://bugs.ruby-lang.org/