http_request: reduce insn size for check_client_connection
commit20c66dbf1ebd0ca993e7a79c9d0d833d747df358
authorEric Wong <e@80x24.org>
Tue, 14 Mar 2017 19:18:55 +0000 (14 19:18 +0000)
committerEric Wong <e@80x24.org>
Tue, 14 Mar 2017 19:18:55 +0000 (14 19:18 +0000)
tree73cfb72ba379293c29b80d0cf268aa462a06f9ee
parent873218e317773462be2a72556d26dc4a723cc7be
http_request: reduce insn size for check_client_connection

Unlike constants and instance variables, class variable access
is not optimized in the mainline Ruby VM.  Use a constant
instead, to take advantage of inline constant caching.

This further reduces runtime instruction size by avoiding a
branch by allocating the Raindrops::TCP_Info object up front.

This reduces the method size by roughly 300 bytes on 64-bit.
lib/unicorn/http_request.rb