[ragel-users] Re: ragel edge side include parser

Adrian Thurston thurs... at cs.queensu.ca
Tue Jan 8 00:07:31 UTC 2008

Hi Todd,

Putting the .* ahead of esi_tags is very costly. It grows the number of
states from 80 to over 300. You can improve this by choosing some point
at which to commit to esi_tags. But first we need to know more about the
language. Is "<" on it's own legal? What is the nature of the "water" in
which your esi_tag "island" is found?


Todd Fisher wrote:
> Okay, I did some more reading and now understand why with -G2 cs
> variable is always the same value.  From chapter 5, page 43:
> "Generally this produces faster running code because it allows the
> machine to encode the current 
> state using the processor's instruction pointer."
> I've also been able to reduce the machine size by merging a few
> redundant states... Still am hoping to get some feedback, regarding
> whether my approach to the parser is reasonable and if there are any
> obvious features of ragel that I'm missing.
> Thanks,
> Todd
> On Jan 6, 2008 5:16 PM, taf2 <todd.fis... at gmail.com
> <mailto:todd.fis... at gmail.com>> wrote:
>     Hi,
>      I've been doing some work on implementing a parser to handle ESI
>     (Edge Side Include) Tags.   I am fairly sure, I have the parser
>     working, but am curious about methods for optimizing.  I noticed that
>     if  I generate my parser using -G1  I get a file about 25K lines.
>     With -T1 I get about 5K lines.   Also, when using -G2  i'm not seeing
>     the cs variable changing.   I noticed some pretty significant changes
>     in size based on some simple changes in how I matched attributes.
>     Looking for any advice on methods for optimizing my parser.     Here's
>     my main parser file:  
>     http://mongrel-esi.googlecode.com/svn/trunk/ext/esi/common.rl
>     Thanks,
>     Todd
>     > 

More information about the ragel-users mailing list