ruby/ext
normal bee5b49aec socket: avoid arg parsing in rsock_s_accept_nonblock
* ext/socket/init.c (rsock_s_accept_nonblock): avoid parsing args
  [ruby-core:71439] [Feature #11339]
* ext/socket/rubysocket.h: adjust prototype
* ext/socket/socket.c (sock_accept_nonblock): make private
* ext/socket/tcpserver.c (tcp_accept_nonblock): ditto
* ext/socket/unixserver.c (unix_accept_nonblock): ditto
* ext/socket/lib/socket.rb (Socket#accept_nonblock):
  implement as wrapper, move RDoc
  (TCPServer#accept_nonblock): ditto
  (UNIXServer#accept_nonblock): ditto

target 0: a (ruby 2.3.0dev (2015-11-12 trunk 52550) [x86_64-linux])
target 1: b (ruby 2.3.0dev (2015-11-12 avoid-kwarg-capi 52550) [x86_64-linux]

-----------------------------------------------------------
accept_nonblock

require 'tempfile'
require 'socket'
require 'io/wait'
nr = 500000
Tempfile.create(%w(accept_nonblock .sock)) do |tmp|
  path = tmp.path
  File.unlink(path)
  s = UNIXServer.new(path)
  addr = Socket.sockaddr_un(path).freeze
  nr.times do
    s.accept_nonblock(exception: false)
    c = UNIXSocket.new(path)
    s.wait_readable
    s.accept_nonblock(exception: false).close
    c.close
  end
end

-----------------------------------------------------------
raw data:

[["accept_nonblock",
  [[4.807877402752638,
    4.930681671947241,
    4.738454818725586,
    4.69268161803484,
    4.684675686061382],
   [4.253904823213816,
    4.255124930292368,
    4.295955188572407,
    4.248479191213846,
    4.213303029537201]]]]

Elapsed time: 45.123040065 (sec)
-----------------------------------------------------------
benchmark results:
minimum results in each 5 measurements.
Execution time (sec)
name            a       b
accept_nonblock   4.685   4.213

Speedup ratio: compare with the result of `a' (greater is better)
name            b
accept_nonblock   1.112

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-16 23:40:15 +00:00
..
-test- Add tests for rb_time_timespec_new 2015-11-10 17:50:38 +00:00
bigdecimal bigdecimal.c: suppress warnings 2015-11-08 06:29:13 +00:00
continuation continuation.c: quiet static-linked-ext 2014-11-27 19:58:04 +00:00
coverage * ext/coverage/coverage.c: Remove extension from require argument. 2015-04-12 04:52:23 +00:00
date suppress warnings 2015-11-08 05:54:29 +00:00
dbm ext: use RARRAY_AREF 2015-11-05 01:09:17 +00:00
digest digest.c: GC guard 2015-05-21 05:03:55 +00:00
etc ext: suppress warnings 2015-04-19 03:19:20 +00:00
fcntl protoize no-arguments functions 2014-09-30 05:25:32 +00:00
fiber * cont.c (ruby_Init_{Continuation_body,Fiber_as_Coroutine}): prefixed 2009-01-20 07:17:28 +00:00
fiddle ext: use RARRAY_AREF 2015-11-05 01:09:17 +00:00
gdbm ext: use RARRAY_AREF 2015-11-05 01:09:17 +00:00
io console.c: check unused args 2015-11-07 00:25:50 +00:00
json parser.c: update 2015-09-25 08:08:58 +00:00
mathn * complex.c (nucomp_canonicalization): renamed. 2008-12-12 23:40:55 +00:00
nkf nkf.c: add semicolon 2014-12-26 06:09:31 +00:00
objspace objspace_dump.c: special const 2015-10-19 06:25:01 +00:00
openssl Commit miss from r52556 2015-11-13 05:03:55 +00:00
pathname * lib/open-uri.rb: Remove indicator for "frozen_string_literal: true". 2015-11-10 11:48:14 +00:00
psych * ext/psych/psych.gemspec: bump version to 2.0.15 2015-11-13 01:08:45 +00:00
pty pty.c: fix example typo [ci skip] 2015-07-19 05:29:21 +00:00
racc/cparse cparse.c: typed data 2014-12-03 00:48:59 +00:00
rbconfig/sizeof sizes.c.tmpl: extract RUBY_DEFINT 2015-06-28 22:24:05 +00:00
readline ext: use RARRAY_AREF 2015-11-05 01:09:17 +00:00
ripper Rename DOTQ to ANDDOT 2015-11-10 09:42:27 +00:00
sdbm ext: use RARRAY_AREF 2015-11-05 01:09:17 +00:00
socket socket: avoid arg parsing in rsock_s_accept_nonblock 2015-11-16 23:40:15 +00:00
stringio use rb_check_arity [ci skip] 2015-10-25 00:43:06 +00:00
strscan allocate structs with wrapper 2015-05-16 12:56:48 +00:00
syslog use rb_check_arity [ci skip] 2015-10-25 00:43:06 +00:00
thread * ext/thread/thread.c: move definitions of Queue, SizedQueue 2015-08-21 23:36:23 +00:00
tk ext: use RARRAY_ASET 2015-11-05 01:17:19 +00:00
win32 win32/registry.rb: size in bytes 2015-08-15 01:51:10 +00:00
win32ole use rb_check_arity [ci skip] 2015-10-25 00:43:06 +00:00
zlib use rb_check_arity [ci skip] 2015-10-25 00:43:06 +00:00
.document * ext/win32ole/win32ole.c: separate WIN32OLE::VARIANT src file 2014-08-02 14:55:36 +00:00
Setup ext/Setup: update 2015-09-24 01:29:10 +00:00
Setup.atheos * ext/dl/*: remove DL as it is replaced by Fiddle. 2014-10-31 21:13:09 +00:00
Setup.nacl * ext/dl/*: remove DL as it is replaced by Fiddle. 2014-10-31 21:13:09 +00:00
Setup.nt * ext/dl/*: remove DL as it is replaced by Fiddle. 2014-10-31 21:13:09 +00:00
extmk.rb common.mk: showflags only once 2015-10-22 14:56:37 +00:00