winnow-rs / winnow

Making parsing a breeze
https://docs.rs/winnow
Other
573 stars 46 forks source link

Write a Parser Performance special topic #191

Open epage opened 1 year ago

epage commented 1 year ago

We should help people in optimizing their parsers, including

See https://epage.github.io/blog/2021/09/optimizing-toml-edit/ for other ideas

We should use the json parser as the guide. We could show diffs of the examples to show what the changes look like.

Open questions

epage commented 1 year ago

Specifically cover the cost of large return types which can show up in surprising ways like just using a tuple (#237)

epage commented 11 months ago

Other sources of ideas

praveenperera commented 1 month ago

Specifically cover the cost of large return types which can show up in surprising ways like just using a tuple (#230)

@epage This is a question I had, when you say watch for large return types. Is it better to call parse_next multiple times and use regular if else branching?

Instead of trying to purely do it all with combinators?

Examples and more context: https://www.perplexity.ai/search/rust-nom-and-winnow-parsing-is-SaJuUbDxSfu09wjpXcOctA

Though in my example, I’m not actually returning, the tuple.

epage commented 1 month ago

FYI I've updated my post to point to #237 which is a more appropriate place to discuss that. Moving this thread there.