unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [PATCH 0/2] eliminate generic ivars from HttpRequest class
@ 2015-06-06  1:58 Eric Wong
  2015-06-06  1:58 ` [PATCH 1/2] move the socket into Rack env for hijacking Eric Wong
  2015-06-06  1:58 ` [PATCH 2/2] http: move response_start_sent into the C ext Eric Wong
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2015-06-06  1:58 UTC (permalink / raw)
  To: unicorn-public

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]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-06  1:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-06  1:58 [PATCH 0/2] eliminate generic ivars from HttpRequest class Eric Wong
2015-06-06  1:58 ` [PATCH 1/2] move the socket into Rack env for hijacking Eric Wong
2015-06-06  1:58 ` [PATCH 2/2] http: move response_start_sent into the C ext Eric Wong

Code repositories for project(s) associated with this inbox:

	../../../unicorn.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).