From: Eric Wong Date: 2013-04-17T10:42:23+09:00 Subject: [ruby-core:54374] Re: [ruby-trunk - Bug #8208] Raise cached exceptions for nonblocking IO to avoid allocation/stack-copying costs "headius (Charles Nutter)" wrote: > Perf change for an implementation of this in JRuby: How does this compare to an implementation which returns symbols like :wait_*able instead of raising exceptions? > The benefit of this change would be that nonblocking IO has zero > wasted overhead. The down side would be that the exceptions raised do > not have a useful backtrace unless debug or verbose. Exceptions for nonblocking I/O still makes --debug too noisy. > If we did this change, we would not have to introduce a separate API > for nonblocking IO that doesn't raise exceptions. I still think it's better to push for an exception-less API for common errors. EAGAIN/EINPROGRESS/EWOULDBLOCK are far too common (and not reasonably avoidable) to be considered exceptions.