From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "ry dahl" Newsgroups: gmane.comp.lang.ruby.mongrel.devel Subject: Re: [PATCH] http11: ~6% performance increase in header parsing Date: Sat, 8 Mar 2008 18:37:53 +0100 Message-ID: <3ae7f4480803080937y20b729e0vb9b549cb8184118f@mail.gmail.com> 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 1204998195 21491 80.91.229.12 (8 Mar 2008 17:43:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Mar 2008 17:43:15 +0000 (UTC) To: mongrel-development-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Original-X-From: mongrel-development-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Sat Mar 08 18:43:41 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: 0768a480b6b28418 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:4 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.50) id 1JY34i-0001ys-Ql for gclrmd-mongrel-development@m.gmane.org; Sat, 08 Mar 2008 18:43:12 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 0283D18586F6; Sat, 8 Mar 2008 12:42:34 -0500 (EST) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.188]) by rubyforge.org (Postfix) with ESMTP id BD68C18586FE for ; Sat, 8 Mar 2008 12:37:55 -0500 (EST) Received: by rv-out-0910.google.com with SMTP id f5so693956rvb.59 for ; Sat, 08 Mar 2008 09:37:54 -0800 (PST) Received: by 10.140.163.3 with SMTP id l3mr2013116rve.68.1204997874058; Sat, 08 Mar 2008 09:37:54 -0800 (PST) Received: by 10.70.94.13 with HTTP; Sat, 8 Mar 2008 09:37:53 -0800 (PST) List-Post: > 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. Nah, you can just define enum header_types { MONGREL_CONTENT_LENGTH, MONGREL_CONTENT_TYPE, etc } and define a single callback to handle them void (*field_cb)(http_parser*, int header_type, char *at, int len) ry