From 70c976bdd85bb8515fea01d6ad6074ef472fc2e0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 14 Nov 2015 02:47:24 +0000 Subject: reduce constant lookup dependencies Unicorn 5 removes some constants we were using, and constant lookups + inline caching are waste of time anyways on newer Rubies with the opt_str_freeze bytecode instruction. This may reduce performance for folks on older Rubies (probably not noticeable); but improves performance for folks on newer Rubies. --- lib/rainbows/epoll/client.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/rainbows/epoll') diff --git a/lib/rainbows/epoll/client.rb b/lib/rainbows/epoll/client.rb index 65fcb3e..2d95a99 100644 --- a/lib/rainbows/epoll/client.rb +++ b/lib/rainbows/epoll/client.rb @@ -63,8 +63,8 @@ module Rainbows::Epoll::Client end def app_call input # called by on_read() - @env[RACK_INPUT] = input - @env[REMOTE_ADDR] = kgio_addr + @env['rack.input'] = input + @env['REMOTE_ADDR'] = kgio_addr @hp.hijack_setup(@env, self) status, headers, body = APP.call(@env.merge!(RACK_DEFAULTS)) return hijacked if @hp.hijacked? @@ -93,7 +93,7 @@ module Rainbows::Epoll::Client Rainbows::Epoll::ResponsePipe).new(io, self, body) return @wr_queue << pipe if @wr_queue[0] stream_pipe(pipe) or return - @wr_queue[0] or @wr_queue << Z + @wr_queue[0] or @wr_queue << ''.freeze end def ev_write_response(status, headers, body, alive) @@ -120,7 +120,7 @@ module Rainbows::Epoll::Client want_more else # pipelined request (already in buffer) - on_read(Z) + on_read(''.freeze) return if @wr_queue[0] || closed? return hijacked if @hp.hijacked? close if :close == @state -- cgit v1.2.3-24-ge0c7