http: move response_start_sent into the C ext
commitc3bc5864d0b8c56adee9544b64c9182d8d4eb206
authorEric Wong <e@80x24.org>
Sat, 6 Jun 2015 01:07:55 +0000 (6 01:07 +0000)
committerEric Wong <e@80x24.org>
Sat, 6 Jun 2015 01:07:55 +0000 (6 01:07 +0000)
tree57a07b0f9a60550af8f7bdaa7e413f10261a2f7e
parent5aa6b7ad7d8847a5d191ecf8606919b7886df7c2
http: move response_start_sent into the C ext

Combined with the previous commit to eliminate the `@socket'
instance variable, this eliminates the last instance variable
in the Unicorn::HttpRequest class.

Eliminating the last instance variable avoids the creation of a
internal hash table used for implementing the "generic" instance
variables found in non-pure-Ruby classes.  Method entry overhead
remains the same.

While this change doesn't do a whole lot for unicorn memory usage
where the HttpRequest is a singleton, it helps other HTTP servers
which rely on this code where thousands of clients may be connected.
ext/unicorn_http/unicorn_http.rl
lib/unicorn/http_request.rb
test/unit/test_http_parser_ng.rb