
On 6/8/10 12:10 AM, Eric Niebler wrote:
On 6/7/2010 9:20 AM, Mathias Gaunard wrote:
Eric Niebler wrote:
On 6/7/2010 5:50 AM, Mathias Gaunard wrote:
I'm always suspect of benchmarks, but I figured I'd post this anyway. <snip> Just an idea: for static xpressive, couldn't you detect at compile-time
Le 07/06/2010 04:58, Eric Niebler wrote: that the expression is truly regular, and use a DFA in that case?
Oh, sure! Why don't you submit a DFA and I'll use it in xpressive? ;-)
How about a warning "you may not be using the optimal tool for the job" until then?
I'm having a hard time getting excited about that.
Are the finite state machine libraries in Boost usable for this at all?
I don't know. At BoostCon, Christophe presented some interesting results pitting MSM against xpressive for some simple regexing. An interesting research project would be to investigate whether xpressive's hybrid static/dynamic NFA design can be applied to DFAs as well, with similar perf wins. This would be a non-trivial undertaking, like completely reimplementing xpressive.
Just to remind you, there's a very good DFA implementation underneath Spirit Lex. The interface is not perfect (Ben has requested for some input in that area), but the implementation is very good. Spirit Lex is proto on top of lexertl (Ben's work). We find it to be one of the fastest lexer, close to performance to the fastest (RE2C) which is a code-gen that generates a humongous switch. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net