yhirose / cpp-peglib

A single file C++ header-only PEG (Parsing Expression Grammars) library
MIT License
879 stars 112 forks source link

Performance comparison with boost::spirit, PEGTL etc.? #282

Closed zengmao closed 11 months ago

zengmao commented 12 months ago

The grammar definition syntax of cpp-peglib seems more pleasant than alternatives like boost::spirit and PEGTL, since a plain text format is used instead of a DSL based on operator overloading or templates. However, does this come with any performance cost? For newcomers like me exploring options, some comparisons will be helpful.

mingodad commented 12 months ago

Go ahead produce the comparisons and show it here !

yhirose commented 11 months ago

@zengmao thanks for the question. As for making a parser, boost::spirit and PEGTL are faster, since they do it on compile time while cpp-peglib does it on runtime. As for performance of a generated parser, I am not sure because I have never tried those libraries...