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
cmd/compile: mod operator is very slow on intel hardware with int64 #59089
Comments
This is expected, |
I have also taken a look at the Rust compiled code, it seems they cleverly check if the upper 32-bits of both the dividend and the divisor are all zero, and fall to faster
|
CC @randall77 |
Seems fine to put in a similar test + 32-bit path in our code. My only question is how universal is this? Skylake was mentioned - how does this fare on other processor vendors / families? |
It is generally true on x86 that an |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
Issue is discussed more with code example in this reddit thread.
TLDR; Mod operator is very slow on intel hardware when used on int type.
What did you expect to see?
Mod operator optimized to handle int types on intel hardwares
What did you see instead?
The mod operator is very slow when used on int types on intel hardware.
The text was updated successfully, but these errors were encountered: