If parsing Haml is taking a long time, you're doing something wrong. A Haml
template should only be parsed once; then the compiled template should be
cached and used for all future generations of the result. The
Haml::Engine#def_method method can be used to do this easily:
http://haml-lang.com/docs/yardoc/Haml/Engine.html#def_method-instance_method.

To answer your original question, no, there are no plans to switch to a
generated parser. The primary reason for this is that Haml parsing shouldn't
ever be a bottleneck. The other reason is that Haml is very far from being a
regular language, which is what Ragel is designed to parse. In fact, it's
also very far from being context-free, which is a more complex class than
regular languages. It would take quite a bit of pre-processing trickery to
get Haml into a form where a generated parser could parse it, at which point
most of the performance gains (that don't matter anyway because parsing
shouldn't be a bottleneck) would likely be lost.

On Tue, Jan 25, 2011 at 6:02 AM, Bruno Azisaka Maciel
<[email protected]>wrote:

> Hi,
>
> is there anyone working on a parser for Haml using Ragel?
> I'm working on a project and Haml is our biggest problem right now. Haml
> takes around 80% of throughput. A friend of mine told me about a migration
> done on Redcloth which changed the old parser to a new one using Ragel.
>
> Is there a plan to change that parser?
>
>
> best regards,
> azisaka
>
> --
> You received this message because you are subscribed to the Google Groups
> "Haml" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected] <haml%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/haml?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to