snacktime
10/31/2006 5:54:00 AM
On 10/30/06, Jeremy Hinegardner <jeremy@hinegardner.org> wrote:
> On Tue, Oct 31, 2006 at 02:14:42PM +0900, ara.t.howard@noaa.gov wrote:
> > On Tue, 31 Oct 2006, snacktime wrote:
> >
> > >Say I'm parsing stuff like http headers, what is going to give better
> > >performance? Strings with regular expressions? StringIO with readline?
> > >splitting strings into arrays on a delimiter? Or is it going to be so
> > >close
> > >it's not really an issue?
> > >
> > >Chris
> >
> > if you try to write your regular expressions badly enough they can surely
> > use
> > the most cpu ;-)
>
> It all 'depends' :-) If you're doing http header parsing, why not just
> use the header parsing in mongrel. It's already available as a C
> extension, probably not going to get much faster than that.
I am using it actually, but I"m writing a proxy and I need to parse
the headers the server returns also. I was thinking about just adding
a parser class to the mongrel parser to do this based on the existing
one, still not decided though.