parsing - Performance of parsers: PEG vs LALR(1) or LL(k) -
i've seen claims optimized peg parsers in general cannot faster optimized lalr(1) or ll(k) parsers. (of course, performance of parsing depend on particular grammar.)
i'd know if there specific limitations of peg parsers, either valid in general or subsets of peg grammars make them inferior lalr(1) or ll(k) performance-wise.
in particular, i'm interested in parser generators, assume output can tweaked performance in particular case. assume parsers optimized , possible tweak particular grammar bit if that's needed improve performance.
found answer packrat vs lalr parsing. quotes it:
l(al)r parsers linear time parsers, too. in theory, neither packrat nor l(al)r parsers "faster".
what matters, in practice, of course, implementation. l(al)r state transitions can executed in few machine instructions ("look token code in vector, next state , action") can extremely fast in practice.
an observation: language front-ends don't spend of time "parsing"; rather, spend lot of time in lexical analysis. optimize ..., , parser speed won't matter much.
Comments
Post a Comment