From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.4 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: unicorn-public@bogomips.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5BC1B6338ED for ; Sat, 6 Jun 2015 01:58:07 +0000 (UTC) From: Eric Wong To: unicorn-public@bogomips.org Subject: [PATCH 0/2] eliminate generic ivars from HttpRequest class Date: Sat, 6 Jun 2015 01:58:01 +0000 Message-Id: <1433555883-24723-1-git-send-email-e@80x24.org> List-Id: 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]