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

Refactor if-else chains to switch in benchmark methods #2756

Conversation

panic08
Copy link
Contributor

@panic08 panic08 commented Oct 7, 2024

For better readability and maintainability, I think we should change the if-else chain to a switch

Copy link
Member

@eamonnmcmanus eamonnmcmanus left a comment

Choose a reason for hiding this comment

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

This makes sense to me. I'd also expect it to be slightly more performant, which is good because that means it interferes less with what the code is actually trying to measure.

I'll note that I don't think anybody actually uses these metrics.

@eamonnmcmanus eamonnmcmanus merged commit 4889453 into google:main Oct 9, 2024
11 checks passed
@panic08 panic08 deleted the refactor-ifelse-to-switch-in-benchmark-methods branch October 9, 2024 15:09
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