1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext
normal 6dda4f17a9 socket: memoize common socket families in fptr->mode
This provides a minor speedup by avoiding an extra syscall

	require 'socket'
	require 'benchmark'
	nr = 100000
	msg = 'hello world'
	buf = ''
	size = msg.bytesize
	puts(Benchmark.measure do
	  UNIXSocket.pair(:SEQPACKET) do |a, b|
	    nr.times do
	      a.sendmsg_nonblock(msg, 0, exception: false)
	      b.recv(size, 0, buf)
	    end
	  end
	end)

             user     system      total        real
before:  0.330000   0.340000   0.670000 (  0.678235)
 after:  0.290000   0.240000   0.530000 (  0.534527)

* ext/socket/rubysocket.h: flags for common socket families
  (rsock_getfamily): update signature
* include/ruby/io.h: comment socket FMODE flags
* ext/socket/init.c (rsock_getfamily): memoize family
* ext/socket/basicsocket.c: adjust rsock_getfamily calls
* ext/socket/ancdata.c: ditto
  [ruby-core:69713] [Feature #11298]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02 01:58:14 +00:00
..
-test- * test/-ext-/popen_deadlock/test_popen_deadlock.rb: test [Bug #11265] 2015-06-25 12:42:07 +00:00
bigdecimal * ext/bigdecimal/bigdecimal.gemspec: Fix require paths for released gem. 2015-06-13 02:35:25 +00:00
continuation
coverage * ext/coverage/coverage.c: Remove extension from require argument. 2015-04-12 04:52:23 +00:00
date date_parse.c: use ALLOCV 2015-06-16 09:46:06 +00:00
dbm
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
fiber
fiddle * include/ruby/ruby.h: $SAFE=2 is now obsolete. 2015-06-18 14:21:03 +00:00
gdbm
io * ext/io/console/depend (.list.chksum): revert a part of r50859, because 2015-06-13 10:47:30 +00:00
json generator.c: allocate structs with wrapper 2015-05-28 07:17:55 +00:00
mathn
nkf
objspace ext/objspace/objspace_dump.c: adjust indent 2015-06-21 03:21:34 +00:00
openssl ext/openssl/ossl_ssl.c: raise if kwargs given in blocking mode 2015-06-24 17:44:01 +00:00
pathname * ext/pathname/lib/pathname.rb (descend): Blockless form supported. 2015-06-14 15:14:46 +00:00
psych psych: allocate structs with wrapper 2015-05-29 05:44:01 +00:00
pty * internal.h (rb_execarg_parent_end): Declared. 2015-04-09 12:44:35 +00:00
racc/cparse
rbconfig/sizeof sizes.c.tmpl: extract RUBY_DEFINT 2015-06-28 22:24:05 +00:00
readline
ripper
sdbm _sdbm.c: fix pointers to shift 2015-02-04 08:35:08 +00:00
socket socket: memoize common socket families in fptr->mode 2015-07-02 01:58:14 +00:00
stringio stringio.c: don't raise after close 2015-03-13 06:04:39 +00:00
strscan allocate structs with wrapper 2015-05-16 12:56:48 +00:00
syslog
thread thread.c: refine enums 2015-02-27 03:55:00 +00:00
tk tkutil.c: fix out-of-bounds access 2015-06-01 01:55:10 +00:00
win32 * ext/win32/Win32API.rb (initialize): accept both a string and an array 2015-02-25 13:08:01 +00:00
win32ole * ext/win32ole/win32ole.c: fix a typo. Patch by @davydovanton 2015-06-04 02:53:11 +00:00
zlib * ext/zlib/zlib.c: Fix indentation for rdoc. 2015-06-11 10:11:30 +00:00
.document
extmk.rb extmk.rb: fix with-ext condition 2015-06-18 22:58:14 +00:00
Setup
Setup.atheos
Setup.emx
Setup.nacl
Setup.nt