speed vs. re2c?

Adrian Thurston thurs... at cs.queensu.ca
Thu Oct 5 22:43:47 UTC 2006


When you use -G2, Ragel generated scanners are very close in performance to 
Re2c generated scanners.

If you comment out the printf statements, make the buffers the same size, 
and run the cppscan examples on 10 megabytes of code then you get something 
like this:

re2c:  0.090
ragel: 0.093

But of course this is just one program on one machine (~ 2GHz intel). 
Personally I don't know how meaningful it is because I don't have any 
estimation of the error. I don't even know if you could estimate the error. 
And finally, it should be noted I did poorly in statistics class.

Sometime in the future I'd like to experiment with optimizations like loop 
unrolling and profiling to try to make Ragel code go faster.


Joshua Haberman wrote:
> Hello, I just discovered Ragel and I'm very excited that it exists!
> I've used re2c and I like it, but re2c isn't as modularized as Ragel --
> the C-specific code generation isn't very well decoupled from the state
> machine code.
> One benefit of re2c is that the generated scanners are extremely fast.
> I'm wondering if anyone has compared Ragel's speed with flex, re2c, or
> runtime regular expression engines like PCRE.
> Josh

More information about the ragel-users mailing list