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

cmd/compile: performance regression compiling crypto/internal/edwards25519/field.feMulGeneric on PPC64 #56497

Closed
pmur opened this issue Oct 31, 2022 · 2 comments
Assignees
Labels
arch-ppc64x compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge
Milestone

Comments

@pmur
Copy link
Contributor

pmur commented Oct 31, 2022

The change to support carry flag optimization on ARM64 (go.dev/cl/432275) caused a large regression in the crypto/ed25519 benchmarks. I missed this regression when reviewing the patch.

The optimization created by using the CarryChainTail priority fails when schedulable memory ops get intertwined with schedulable CarryChainTail ops like ADDZ on PPC64. This leads to many avoidable CA bit clobbers.

What did you expect to see?

No difference in benchmark tests.

What did you see instead?

name              old time/op  new time/op  delta
KeyGeneration-2   27.2µs ± 0%  29.6µs ± 0%   +9.05%  (p=1.000 n=1+1)
NewKeyFromSeed-2  23.9µs ± 0%  29.4µs ± 0%  +23.13%  (p=1.000 n=1+1)
Signing-2         33.7µs ± 0%  37.2µs ± 0%  +10.36%  (p=1.000 n=1+1)
Verification-2    68.3µs ± 0%  88.8µs ± 0%  +30.06%  (p=1.000 n=1+1)
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Oct 31, 2022
@pmur pmur changed the title cmd/compile: performance regression compiling crypto/internal/edwards25519/field.feMulGeneric cmd/compile: performance regression compiling crypto/internal/edwards25519/field.feMulGeneric on PPC64 Oct 31, 2022
@mknyszek
Copy link
Contributor

mknyszek commented Nov 2, 2022

In triage, context from @cherrymui, @pmur is already looking into it so assigning it to you.

@mknyszek mknyszek modified the milestones: Backlog, Go1.20 Nov 2, 2022
@gopherbot
Copy link

Change https://go.dev/cl/447435 mentions this issue: cmd/compile/internal/ssa: re-adjust CarryChainTail priority

@golang golang locked and limited conversation to collaborators Nov 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-ppc64x compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants