From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tony Newsgroups: gmane.comp.lang.ruby.mongrel.devel Subject: Re: Pure Ruby HTTP parser Date: Sat, 26 Apr 2008 17:33:09 -0600 Message-ID: References: <3ae7f4480804240438g62ed7190if2a84ff08dd2fe34@mail.gmail.com> Reply-To: mongrel-development-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1929384260==" X-Trace: ger.gmane.org 1209252822 30510 80.91.229.12 (26 Apr 2008 23:33:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 26 Apr 2008 23:33:42 +0000 (UTC) To: mongrel-development-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Original-X-From: mongrel-development-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Sun Apr 27 01:34:17 2008 Return-path: Envelope-to: gclrmd-mongrel-development@m.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; bh=BirXVrxLMmNpquT9TpSm30rEyP/IZSMu/4+66AvXdlU=; b=Gtb3zV9B/bzMUT41zBYS1VsS9LVfTJkAM/dXr0T0BmBjctJh2eC2UqLKu/qW1Cb6lsH6dVGGe6/hkWnXUvQTRKt+N9b8//4HtXHIIAFwYbOxjdAMTLRX7D6mmTD5q9RSGDpiLnw0FT58v02ucxNRfIiw2zW/N9ZFQ8FMtxXIpiM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=M1h40Xpuf+9mgSEPX/duKr0CsxmGQ4t+g+VaT6L9LbuR7PV+sMyEzKt/2ZvOQtHYE63fTp+isDoAAcNwA3z6QCvWi6sPzATwlkwA78jS2nGjfGKWH1p9vZTlJBmsyNykusm92Q5hHgkFXhnXWyf4cbsPmD5i1+JlNUVvDcJAOII= In-Reply-To: <3ae7f4480804240438g62ed7190if2a84ff08dd2fe34-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> X-Google-Sender-Auth: ae9aebd44e296b40 X-BeenThere: mongrel-development-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.10 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:51 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.50) id 1JptuI-0002WC-9J for gclrmd-mongrel-development@m.gmane.org; Sun, 27 Apr 2008 01:34:14 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 658D218585FF; Sat, 26 Apr 2008 19:33:31 -0400 (EDT) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.29]) by rubyforge.org (Postfix) with ESMTP id 0414318585F3 for ; Sat, 26 Apr 2008 19:33:13 -0400 (EDT) Received: by yw-out-2324.google.com with SMTP id 5so1006434ywh.59 for ; Sat, 26 Apr 2008 16:33:09 -0700 (PDT) Received: by 10.150.79.42 with SMTP id c42mr2232594ybb.168.1209252789774; Sat, 26 Apr 2008 16:33:09 -0700 (PDT) Received: by 10.150.124.9 with HTTP; Sat, 26 Apr 2008 16:33:09 -0700 (PDT) List-Post: --===============1929384260== Content-Type: multipart/alternative; boundary="----=_Part_125_18022594.1209252789768" ------=_Part_125_18022594.1209252789768 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I pushed an updated version here: http://git.rubini.us/?p=code;a=blob;f=lib/mongrel/http11_parser.rb.rl;h=60c8f3d2519dc1673ef0b4107d40a9df9eca0662;hb=7d246b17efc0ac37db6c241729f6b0e298f49950 It's now confirmed working with Mongrel::HttpServer on Rubinius with a "Hello, world!" Mongrel::HttpHandler. It can be used to generate a goto-driven FSM using Rubinius assembly: http://git.rubini.us/?p=code;a=blob;f=lib/mongrel/http11.rb;h=435f643ea105f7adc486dc06ab960392c3dfeab5;hb=7d246b17efc0ac37db6c241729f6b0e298f49950 Some performance figures: MRI + C extension, parsing 10,000 requests: 0.150000 0.000000 0.150000 ( 0.152268) Rubinius + Rubinius.asm parser, parsing 10,000 requests: 20.500086 0.000000 20.500086 ( 20.500085) So, presently ~135x slower than the C extension on MRI :) -- Tony Arcieri medioh.com ------=_Part_125_18022594.1209252789768 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I pushed an updated version here:

http://git.rubini.us/?p=code;a=blob;f=lib/mongrel/http11_parser.rb.rl;h=60c8f3d2519dc1673ef0b4107d40a9df9eca0662;hb=7d246b17efc0ac37db6c241729f6b0e298f49950

It's now confirmed working with Mongrel::HttpServer on Rubinius with a "Hello, world!" Mongrel::HttpHandler.

It can be used to generate a goto-driven FSM using Rubinius assembly:

http://git.rubini.us/?p=code;a=blob;f=lib/mongrel/http11.rb;h=435f643ea105f7adc486dc06ab960392c3dfeab5;hb=7d246b17efc0ac37db6c241729f6b0e298f49950

Some performance figures:

MRI + C extension, parsing 10,000 requests:
  0.150000   0.000000   0.150000 (  0.152268)

Rubinius + Rubinius.asm parser, parsing 10,000 requests:
 20.500086   0.000000  20.500086 ( 20.500085)

So, presently ~135x slower than the C extension on MRI :)

--
Tony Arcieri
medioh.com

------=_Part_125_18022594.1209252789768-- --===============1929384260== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Mongrel-development mailing list Mongrel-development-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/mongrel-development --===============1929384260==--