Skip to content
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

perf(parser): Restore pre-consolidation performance #251

Merged
merged 5 commits into from
Jun 14, 2023
Merged

Conversation

epage
Copy link
Collaborator

@epage epage commented Jun 14, 2023

#247 consolidated some of the parsers as suggested in #98 but there was a report of a slowdown from this change.

While this PR makes several changes, the core improvement is adding #[inline(always)] to the Parser::parse_next impls that we provide for users. I assume that created a barrier in the compiler so it couldn't optimize out the overhead from take_whiles dispatching. Somehow this only made a big difference with the ascii:: parsers and not from direct uses of take_while.

  • winnow 0.4.4 for parse/hcl-edit/deeply_nested.tf: 15.235 µs
  • winnow 0.4.6 for parse/hcl-edit/deeply_nested.tf: 18.273 µs
  • winnow 0.4.4 for parse/hcl-edit/deeply_nested.tf: 14.513 µs

@epage epage mentioned this pull request Jun 14, 2023
2 tasks
@epage epage merged commit ece4139 into winnow-rs:main Jun 14, 2023
@epage epage deleted the perf branch June 14, 2023 20:25
@coveralls
Copy link

coveralls commented Oct 7, 2024

Pull Request Test Coverage Report for Build 5271675064

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 15 of 15 (100.0%) changed or added relevant lines in 1 file are covered.
  • 10 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.06%) to 49.201%

Files with Coverage Reduction New Missed Lines %
src/ascii/mod.rs 2 53.65%
src/stream/mod.rs 2 31.84%
src/parser.rs 6 58.49%
Totals Coverage Status
Change from base Build 5083769027: 0.06%
Covered Lines: 1232
Relevant Lines: 2504

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants