From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Evan Weaver" Newsgroups: gmane.comp.lang.ruby.mongrel.devel Subject: Re: [PATCH] http11: ~6% performance increase in header parsing Date: Sat, 8 Mar 2008 03:14:40 -0500 Message-ID: References: <20080229015309.GA9080@untitled> <20080303044659.5a550c19.zedshaw@zedshaw.com> <20080302123712.GA13979@hand.yhbt.net> <20080306075421.GA1583@hand.yhbt.net> <3ae7f4480803060153v18e955a5j9038f93e558f81d1@mail.gmail.com> <20080308081210.GA30702@hand.yhbt.net> Reply-To: mongrel-development-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1204964094 22049 80.91.229.12 (8 Mar 2008 08:14:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Mar 2008 08:14:54 +0000 (UTC) To: mongrel-development-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Original-X-From: mongrel-development-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Sat Mar 08 09:15:21 2008 Return-path: Envelope-to: gclrmd-mongrel-development@m.gmane.org In-Reply-To: <20080308081210.GA30702-r0bfCMRs158eIZ0/mPfg9Q@public.gmane.org> Content-Disposition: inline X-Google-Sender-Auth: bdb4b85910a80d8b X-BeenThere: mongrel-development-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: mongrel-development-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: mongrel-development-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Xref: news.gmane.org gmane.comp.lang.ruby.mongrel.devel:2 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.50) id 1JXuD8-0007QU-S6 for gclrmd-mongrel-development@m.gmane.org; Sat, 08 Mar 2008 09:15:19 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 29D6918586BE; Sat, 8 Mar 2008 03:14:43 -0500 (EST) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.187]) by rubyforge.org (Postfix) with ESMTP id 357F818586BE for ; Sat, 8 Mar 2008 03:14:40 -0500 (EST) Received: by rv-out-0910.google.com with SMTP id f5so561387rvb.59 for ; Sat, 08 Mar 2008 00:14:40 -0800 (PST) Received: by 10.141.145.11 with SMTP id x11mr1527909rvn.215.1204964080388; Sat, 08 Mar 2008 00:14:40 -0800 (PST) Received: by 10.114.205.10 with HTTP; Sat, 8 Mar 2008 00:14:40 -0800 (PST) List-Post: Upgrading ragel is fine with me. Evan On Sat, Mar 8, 2008 at 3:12 AM, Eric Wong wrote: > ry dahl wrote: > > > Hi Eric, > > > > > I'm getting an even bigger (~22%) performance > > > improvement by predefining > > > some common HTTP headers as global frozen > > > strings upfront (r992) > > > > Why don't you do this in Ragel? It will be faster and you don't need > > to depend on bsearch. I pull out content-length header in ragel in > > ebb: > > http://github.com/ry/ebb/tree/master/src/parser.rl > > (although there is a bug with this because (content_length | > > message_header ) needs some priorities set so message_header isn't > > matching content-length too. should be > > (content_length >2 | message_header >1 ) > > or something). > > Then I'd have to define a new C function for every header I wanted to > optimize for, and then also point to that function inside the Ragel file > for each header. > > Unless we use something like ERB to generate this code for both Ragel > and C, I'm not sure it's worth the effort to go through with all the > extra code. > > Currently, with my C/CPP code, I can add or remove headers to memoize > strings for by adding or removing one line per header in the C file. > Pretty much as easy as it gets maintenance-wise. > > > > Also - the state machine should be upgraded to compile with ragel 6. > > this basically involves removing %write eof; > > Yes. At the same time, I'm not sure if I should force every other > developer to upgrade... Evan? Zed? > > -- > Eric Wong > > > _______________________________________________ > Mongrel-development mailing list > Mongrel-development-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC