-
Notifications
You must be signed in to change notification settings - Fork 292
Special case bool literals #784
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
Conversation
CodSpeed Performance ReportMerging #784 will improve performances by 10.38%Comparing Summary
Benchmarks breakdown
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I read from the benchmark that this makes things slower?
if let Ok(bool) = k.strict_bool() { | ||
if bool { | ||
expected_bool.true_id = Some(id); | ||
} else { | ||
expected_bool.false_id = Some(id); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The chain of if let Ok(...) = input.x()
here just seems to scream at me for the input-as-enum we spoke about the other day...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed!
I guess so. I don't trust our benchmarks because of all of the noise going on, but this is the one I would expect to get slower, so maybe it's real. Nonetheless, I'm surprised it's slower at all. That benchmark should just consist of checking a |
Case in point: another benchmark shows a larger improvement than the literal benchmark shows a regression, which is indicates to me there’s a lot of noise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I see no harm in adding this and I think if the benchmark regression is real, it's small and we can win it back in future with input-as-enum or other optimizations.
I did this while working on #783 but it's not needed there. Posting it here in case we think it's worth it. @davidhewitt can you take a look and close if you think it's not worth it or too far from what you'd implement?