* configure.in: add additional flag variable descriptions, which
are appended to common flags, e.g., CFLAGS, CPPFLAGS, etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
complemented method entries or not. There are some cases that callabe
method entries do not have defined_class.
* vm_method.c (rb_method_entry_complement_defined_class):
use METHOD_ENTRY_COMPLEMENTED_SET().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c (method_definition_addref_complement): introduced.
def->alias_count is used to decide warn or do not warn at method
redefinition. Complented methods should not prevent redefiniton
warnings.
* vm_method.c (rb_method_definition_release): release def iff
alias_count == 0 && complemented_count == 0.
* test/ruby/test_module.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
regular expressions from 7.0.0 to 8.0.0
(with help from Kimihito Matsui) [Feature #11563]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
of clen must be nil.
* ext/socket/ancdata.c (bsock_sendmsg_internal): handle nil of clen.
fixes test errors introduced at r52602.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/socket/init.c (is_socket): extract predicate to see if the
given fd is a socket.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/socket/socket.c (sock_connect_nonblock):
avoid argument parsing in C.
[ruby-core:71439] [Feature #11339]
* ext/socket/lib/socket.rb (Socket#connect_nonblock):
new wrapper for private method, move RDoc
target 0: a (ruby 2.3.0dev (2015-11-12 trunk 52540) [x86_64-linux])
target 1: b (ruby 2.3.0dev (2015-11-12 avoid-kwarg-capi 52540) [x86_64-linux]
-----------------------------------------------------------
connect_nonblock
require 'tempfile'
require 'socket'
require 'io/wait'
nr = 500000
Tempfile.create(%w(connect_nonblock .sock)) do |tmp|
path = tmp.path
File.unlink(path)
s = UNIXServer.new(path)
addr = Socket.sockaddr_un(path).freeze
nr.times do
c = Socket.new(Socket::AF_UNIX, Socket::SOCK_STREAM)
while c.connect_nonblock(addr, exception: false) == :wait_writable
c.wait_writable
end
s.accept.close
c.close
end
end
-----------------------------------------------------------
raw data:
[["connect_nonblock",
[[4.014209181070328,
3.8479955345392227,
3.981342639774084,
4.471840236335993,
3.7867715656757355],
[3.639054525643587,
3.58337214961648,
3.525284394621849,
3.52646067738533,
3.511393066495657]]]]
Elapsed time: 37.889623996 (sec)
-----------------------------------------------------------
benchmark results:
minimum results in each 5 measurements.
Execution time (sec)
name a b
connect_nonblock 3.787 3.511
Speedup ratio: compare with the result of `a' (greater is better)
name b
connect_nonblock 1.078
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/socket/init.c (rsock_s_recvfrom_nonblock):
avoid arg parsing with C API
[ruby-core:71439] [Feature #11339]
* ext/socket/basicsocket.c (bsock_recv_nonblock):
adjust for above change, make private
* ext/socket/socket.c (sock_recvfrom_nonblock): ditto
* ext/socket/udpsocket.c (udp_recvfrom_nonblock): ditto
* ext/socket/lib/socket.rb (BasicSocket#recv_nonblock):
new wrapper for private method, move RDoc
(Socket#recvfrom_nonblock): ditto
(UDPSocket#recvfrom_nonblock): ditto
Note, not adding bm_recv_nonblock.rb to benchmark/ directory
since it is non-portable. It is only in this commit message.
Benchmark results + code
target 0: a (ruby 2.3.0dev (2015-11-12 trunk 52540) [x86_64-linux])
target 1: b (ruby 2.3.0dev (2015-11-12 avoid-kwarg-capi 52540) [x86_64-linux]
-----------------------------------------------------------
recv_nonblock
require 'socket'
nr = 1000000
msg = 'hello world'
buf = ''
size = msg.bytesize
UNIXSocket.pair(:SEQPACKET) do |a, b|
nr.times do
a.sendmsg(msg)
b.recv_nonblock(size, 0, buf, exception: false)
end
end
-----------------------------------------------------------
raw data:
[["recv_nonblock",
[[1.83511221408844,
1.8703329525887966,
1.8448856547474861,
1.859263762831688,
1.8331583738327026],
[1.5637447573244572,
1.4062932096421719,
1.4247371144592762,
1.4108827747404575,
1.4802536629140377]]]]
Elapsed time: 16.530452496 (sec)
-----------------------------------------------------------
benchmark results:
minimum results in each 5 measurements.
Execution time (sec)
name a b
recv_nonblock 1.833 1.406
Speedup ratio: compare with the result of `a' (greater is better)
name b
recv_nonblock 1.304
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c (iseq_peephole_optimize): optimize tail calls on aref
and aset specialized instructions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/set.rb: Move << out of the begin block that ensures pop.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
#select!, #^, #classify): Micro-optimize some methods for
performance and readability.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* struct.c (rb_struct_aref, rb_struct_aset): show the given index,
not offset index, in the error messages when the offset is out
of the range.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c (set_method_visibility): should fail if the receiver
is frozen. [ruby-core:71489] [Bug #11687]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e