ruby/ext
normal eda2441b53 socket: avoid arg parsing in bsock_sendmsg_internal
* ext/socket/ancdata.c (bsock_sendmsg_internal): avoid arg parsing
  [ruby-core:71439] [Feature #11339]
  (rsock_bsock_sendmsg): make private, adjust for above
  (rsock_bsock_sendmsg_nonblock): ditto
* ext/socket/rubysocket.h: adjust prototypes
  (rsock_opt_false_p): remove
* ext/socket/basicsocket.c (rsock_init_basicsocket):
  define private methods
* ext/socket/lib/socket.rb (BasicSocket#sendmsg): new wrapper
  (BasicSocket#sendmsg_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]

-----------------------------------------------------------
sendmsg_nonblock

require 'socket'
nr = 1_000_000
i = 0
msg = '.'
buf = '.'
begin
  r, w = UNIXSocket.pair(:SEQPACKET)
  while i < nr
    i += 1
    w.sendmsg_nonblock(msg, exception: false)
    r.recv(1, 0, buf)
  end
ensure
  r.close
  w.close
end

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

[["sendmsg_nonblock",
  [[1.875997293740511,
    1.8452614955604076,
    1.8449317328631878,
    1.8418389447033405,
    1.869386937469244],
   [1.5175109766423702,
    1.4987873211503029,
    1.4989623799920082,
    1.47918451577425,
    1.5017359890043736]]]]

Elapsed time: 16.775453245 (sec)
-----------------------------------------------------------
benchmark results:
minimum results in each 5 measurements.
Execution time (sec)
name             a       b
sendmsg_nonblock   1.842   1.479

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17 01:05:30 +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 bsock_sendmsg_internal 2015-11-17 01:05:30 +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
extmk.rb common.mk: showflags only once 2015-10-22 14:56:37 +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