-
Notifications
You must be signed in to change notification settings - Fork 40
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
Parsing takes 30% longer just by adding Located
to the input
#72
Comments
Geal tried that but felt it was brittle. Unfortunately, I can't find where we talked about that. pom takes the approach of Parser inputs being a |
I'm assuming the Something we can do to make this easier for parser-writers is Probably my biggest concern is losing out on the beauty of the pure-function model. I'm especially concerned with how users of the library will react. |
What if the API guarentee for This means only combinators like This also means that errors won't need to track the input anymore unless you are doing an error tree. |
There was no single PR that "closed" this. The main PRs are
There is some remaining documentation work. A lot of the parser doc comments still use the old-style function signature. They just get called directly, so no PRs that serve as migration examples include
For the common cases, this appears to be neutral on performance or has a slight benefit (despite the double indirection) v0.4.7
In #268, we confirmed that for parsers like The main risk was that we were going to lose the "core" of what made nom and what makes winnow: straightforward, easy to write code. The pure-functional nature of the old API seemed to make this trivial. With the way we got the API contract setup in this, the code feels just as simple or simpler. We did check with users of winnow in #268, VorpalBlade/chezmoi_modify_manager#20, metent/uair#11, organize-rs/organize#2, and resistor/rsrc-rs#1 to see if there were concerns over the new API but there weren't, only in making the upgrade path smooth. |
When evaluating location / span solutions and checking there performance, I found:
Located<I>
takes about a 30% performance hit overI
without actually capturing spansLocated
took the json benchmark from 1.1126 µs to 1.4623 µsLocated
took the json benchmark from 1.4362 µs (pori) to 1.9520 µsStateful<I, ()>
has negligible performance impactStateful
withusize
,(usize, usize)
, and(usize, usize, usize)
mirrors the Located performance and then continued to get slower from there.See also
The text was updated successfully, but these errors were encountered: