-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: missing BCE optimization cases #64272
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
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
Comments
Change https://go.dev/cl/543661 mentions this issue: |
CC @golang/compiler |
gopherbot
pushed a commit
that referenced
this issue
Apr 26, 2024
Try to save a comparison in the loop bodies of Compact and CompactFunc. Note: due to #64272, some bound checks still fail to be removed. │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ Compact/nil-4 4.191n ± 9% 3.402n ± 1% -18.84% (p=0.000 n=10) Compact/one-4 5.289n ± 2% 4.553n ± 2% -13.93% (p=0.000 n=10) Compact/sorted-4 9.865n ± 0% 6.882n ± 1% -30.24% (p=0.000 n=10) Compact/2_items-4 11.10n ± 2% 12.11n ± 2% +9.00% (p=0.000 n=10) Compact/unsorted-4 9.831n ± 3% 6.918n ± 2% -29.62% (p=0.000 n=10) Compact/many-4 16.40n ± 4% 14.90n ± 1% -9.20% (p=0.000 n=10) Compact/dup_start-4 29.87n ± 0% 28.06n ± 3% -6.04% (p=0.001 n=10) Compact_Large/all_dup-4 13.11µ ± 0% 13.12µ ± 0% ~ (p=0.971 n=10) Compact_Large/no_dup-4 6.972µ ± 0% 5.806µ ± 0% -16.73% (p=0.000 n=10) CompactFunc/nil-4 5.300n ± 0% 5.309n ± 1% ~ (p=0.289 n=10) CompactFunc/one-4 6.051n ± 1% 6.442n ± 3% +6.46% (p=0.000 n=10) CompactFunc/sorted-4 16.24n ± 1% 12.79n ± 2% -21.24% (p=0.000 n=10) CompactFunc/2_items-4 17.89n ± 1% 17.75n ± 0% -0.75% (p=0.000 n=10) CompactFunc/unsorted-4 16.26n ± 0% 12.83n ± 1% -21.07% (p=0.000 n=10) CompactFunc/many-4 30.71n ± 1% 29.07n ± 0% -5.32% (p=0.000 n=10) CompactFunc/dup_start-4 78.94n ± 1% 67.19n ± 1% -14.89% (p=0.000 n=10) CompactFunc_Large/all_dup-4 3.277m ± 0% 3.692m ± 2% +12.67% (p=0.000 n=10) CompactFunc_Large/no_dup-4 4.019m ± 0% 2.826m ± 1% -29.68% (p=0.000 n=10) geomean 109.6n 96.99n -11.47% Change-Id: Ia4c78fa62e7e9f4ff6a39d0e0a0a84cecf79b9cb GitHub-Last-Rev: cea3d93 GitHub-Pull-Request: #64273 Reviewed-on: https://go-review.googlesource.com/c/go/+/543661 Reviewed-by: Keith Randall <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Joedian Reid <[email protected]> Auto-Submit: Keith Randall <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
https://github.com/golang/go/blob/go1.21.4/src/slices/slices.go#L346-L385
And
What did you expect to see?
No bound checks.
What did you see instead?
Many bound checks.
This problem might have been reported before, but I couldn't find it now.
The text was updated successfully, but these errors were encountered: