-
Notifications
You must be signed in to change notification settings - Fork 158
Change utf8LengthByLeader to a branching impl #635
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
The simple branching implementation is more efficient in the majority of use cases where the result is branched on anyway. In other cases, branch prediction should do a decent job on typical text.
All the benchmarks that change more than 5% with GHC 9.12.2 on my machine: Expand
|
@Lysxia would you please take a look? |
I'm currently traveling and of limited availability. I can have a look next week. |
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.
LGTM The + in the benchmarks seem to be mostly noise because I don't see them when I try to rerun them.
The simple branching implementation is more efficient in the majority of use cases where the result is branched on anyway. In other cases, branch prediction should do a decent job on typical text.
Closes #630.