[rust-dev] Ragel support for Rust

Patrick Walton pwalton at mozilla.com
Sun Jul 29 12:51:08 PDT 2012


On 07/29/2012 11:43 AM, Erick Tryzelaar wrote:
> Unfortunately there are some pretty severe performance issues at the moment.
> Ragel supports two state machine styles, table-driven and goto-driven. My
> backend uses tables, but since Rust doesn't yet support global constant
> vectors, I need to malloc the state machine table on every function call. This
> results in the [ragel-based url
> parser](https://github.com/erickt/ragel/blob/rust/examples/rust/url.rl)
> being about
> 10 times slower than the equivalent table-based parser in OCaml. You can see
> the generated code [here](https://gist.github.com/3200980).

Another thing you might try is using fixed-length vectors instead of 
heap-allocated vectors.

Patrick



More information about the Rust-dev mailing list