With the mainline Ruby VM, generic instance variables are implemented as
a st (hash) table for each object costing at least 192 bytes. This
isn't a huge problem for unicorn as it only ever allocates one
HttpRequest object, but still makes the HttpRequest class less suitable
for other servers.
While generic ivars will be less expensive when Ruby 2.3 is released in
December, we're still better off eliminating them entirely as they're
not going to be cheaper than T_OBJECT instance variables.
With this, I'll probably tag and release 5.0.0-rc1 soon.
Eric Wong (2):
move the socket into Rack env for hijacking
http: move response_start_sent into the C ext
ext/unicorn_http/unicorn_http.rl | 26 +++++++++++++++++++++++---
lib/unicorn/http_request.rb | 9 ++++-----
test/unit/test_http_parser_ng.rb | 11 +++++++++++
3 files changed, 38 insertions(+), 8 deletions(-)
Note: Yes, [PATCH 1/2] introduces a unicorn-specific field into the
Rack env, but unicorn is not the only server with
`env["#{servername}.socket"]' in the Rack env.
And [PATCH 2/2] isn't useful without [PATCH 1/2]