Skip to content
  • Misaki Shioi's avatar
    9f924e2f
    Improve APIs for Globally Enabling/Disabling fast_fallback in Socket (#12257) · 9f924e2f
    Misaki Shioi authored
    This change includes the following updates:
    - Added an environment variable `RUBY_TCP_NO_FAST_FALLBACK` to control enabling/disabling fast_fallback
    - Updated documentation and man pages
    - Revised the implementation of Socket.tcp_fast_fallback= and Socket.tcp_fast_fallback, which previously performed dynamic name resolution of constants and variables. As a result, the following performance improvements were achieved:
    
    (Case of 1000 executions of `TCPSocket.new` to the local host)
    
    Rehearsal -----------------------------------------
    before   0.031462   0.147946   0.179408 (  0.249279)
    after    0.031164   0.146839   0.178003 (  0.346935)
    -------------------------------- total: 0.178003sec
    
                user     system      total        real
    before   0.027584   0.138712   0.166296 (  0.233356)
    after    0.025953   0.127608   0.153561 (  0.237971)
    9f924e2f
    Improve APIs for Globally Enabling/Disabling fast_fallback in Socket (#12257)
    Misaki Shioi authored
    This change includes the following updates:
    - Added an environment variable `RUBY_TCP_NO_FAST_FALLBACK` to control enabling/disabling fast_fallback
    - Updated documentation and man pages
    - Revised the implementation of Socket.tcp_fast_fallback= and Socket.tcp_fast_fallback, which previously performed dynamic name resolution of constants and variables. As a result, the following performance improvements were achieved:
    
    (Case of 1000 executions of `TCPSocket.new` to the local host)
    
    Rehearsal -----------------------------------------
    before   0.031462   0.147946   0.179408 (  0.249279)
    after    0.031164   0.146839   0.178003 (  0.346935)
    -------------------------------- total: 0.178003sec
    
                user     system      total        real
    before   0.027584   0.138712   0.166296 (  0.233356)
    after    0.025953   0.127608   0.153561 (  0.237971)
Loading