-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime performance comparison with boost::spirit::x3 #9
Comments
I will look into this after the Cologne WG21 meeting. To go over it quickly, something like this can be achieved with |
I created a repo comparing your above example with a somewhat equivalent example with scnlib: https://github.com/eliaskosunen/scnlib-spirit-benchmark Spirit is almost twice as fast in this example. This is because scnlib doesn't support this use case well; there's a lot of boilerplate compared to spirit, and the input needs to be scanned and the stream needs to be allocated twice. I consider this a bug, and this is something that needs to be fixed before the next release. |
Actually, my benchmarks were a little off; the time difference is ~25%. This is still a bug, though |
By making |
At a first glance this library seems to be targeting simple pattern parsing and not grammar parsing (that's the one that I need most of the time) but simple parsing can also be done with boost spirit x3 so I use that library for more or less for all string parsing.
Since this is library is now the basis of a C++ standard proposal I'd be interested in the runtime performance compared to the library that I would like to see being the basis of a standardization efforts - boost::spirit::x3.
I wasn't able to find an example but my basic pattern is usually not a single item but a list of items of unknown length so comparison with something like this would be nice:
This can be executed inside https://wandbox.org/
The text was updated successfully, but these errors were encountered: