Actions
Feature #4560
closed[PATCH] lib/net/protocol.rb: avoid exceptions in rbuf_fill
Feature #4560:
[PATCH] lib/net/protocol.rb: avoid exceptions in rbuf_fill
Description
Blindly hitting IO#read_nonblock() and raising is expensive due
to two factors:
- method cache being scanned/cleared when the IO::WaitReadable
extended class is GC-ed - backtrace generation
This reduces the likelyhood of an IO::WaitReadable exception,
but spurious wakeup can still occur due to bad TCP checksums.
This optimization only applies to non-OpenSSL sockets. I am
using IO#wait here instead of IO.select() since IO#wait is not
available on OpenSSL sockets.
Files
Actions