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

math/big: regression in BitLen #57014

Closed
rsc opened this issue Dec 1, 2022 · 3 comments
Closed

math/big: regression in BitLen #57014

rsc opened this issue Dec 1, 2022 · 3 comments
Assignees
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Dec 1, 2022

CL 450055 replaced big.Int.BitLen with a portable constant-time operation for fear of bits.LeadingZeros using a lookup table on some architectures (notably not on x86, which uses a hardware instruction). @drchase's benchmarks found https://perf.golang.org/search?q=upload%3A20221130.13+pkg%3Agithub.com%2Fericlagergren%2Fdecimal%2Fbenchmarks, non-crypto code with a significant performance hit for a property (constant-time) it didn't need.

Talked to @FiloSottile, and he is going to send a CL removing use of big.Int.BitLen from crypto code and restoring the old implementation.

Filing issue so we remember to submit the CL before the release.

@rsc rsc added this to the Go1.20 milestone Dec 1, 2022
@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Dec 1, 2022
@ericlagergren
Copy link
Contributor

Sorry :)

@gopherbot
Copy link

Change https://go.dev/cl/454617 mentions this issue: math/big: fix BitLen performance regression

@golang golang locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

6 participants