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

Major performance improvement achieved through fixing clippy warnings #35

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pyros82
Copy link

@pyros82 pyros82 commented Apr 11, 2024

Most notable performance problem was the code used Result::ok_or() instead of Result::ok_or_else(||), thus causing the creation of the error strings / objects regardless of whether there was an error or not. This reduced Parsed::from_value() times about 50 fold.

I then followed to fix all clippy warnings, and to add a cargo clippy step to the ci.yaml build section, so that we ensure clippy is happy in the future too.

Avishay Yagoda and others added 4 commits May 9, 2024 22:00
Running clippy in CI to ensure it doesn't break again. Forcing clippy to pass without any warnings. Fixed warnings added by newer rustc.
@vmalloc
Copy link

vmalloc commented Jun 4, 2024

@jstewmon any chance you can give this one a quick look and perhaps merge it into a new version? This is a very significant performance gain compared to the current stable version, with little to no risk IMO

Copy link
Contributor

@gquittet gquittet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the pull request with some examples and everything is running fine.
So looks good to me! 👍
Unfortunately I haven't the rights to merge this work.
Can you do it @jstewmon or @mplanchard when you have time? 🙏
Thank you ! 🤟

@jstewmon
Copy link
Contributor

jstewmon commented Jul 1, 2024

Hi, thank you for your interest in contributing. ❤️ Sorry for the slow response; we don't have much capacity to service this project currently.

Thank you for making a few separate commits - I was able pick the ok_or_else changes while doing some work in this repo today. 🙌

I'd be interested in accepting the clippy-related changes if you can parcel them out into a couple of separate PRs, so that I can quickly verify the ones that are automatic fixes and then more carefully review the hand crafted ones. I'd also like to isolate whatever change necessitated the library changes and have a more detailed explanation of why the library change is needed.

@pyros82
Copy link
Author

pyros82 commented Jul 2, 2024 via email

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.

4 participants