-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
image/jpeg: improve decoder performance by ~12% #71618
base: master
Are you sure you want to change the base?
Conversation
improve JPEG decoder performance by about 10-14% by unrolling shift-clamp and unzig loops.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
The benchmark results and experimentation playground is here |
This PR (HEAD: 58ac490) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/647835. Important tips:
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/647835. |
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/647835. |
A potential improvement if the dst array is 0'd out writeDst := func(index int) {
c := (*b)[index]
if c < -127 {
return
}
c += 128
if c > 255 {
c = 255
}
dst[(index/8)*stride+(index%8)] = uint8(c)
} |
Message from Jorropo: Patch Set 1: Commit-Queue+1 (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/647835. |
Message from Go LUCI: Patch Set 1: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2025-02-07T22:40:00Z","revision":"fefb5f95a8096b1567fa78c9caff39cec65fc44f"} Please don’t reply on this GitHub thread. Visit golang.org/cl/647835. |
Message from Jorropo: Patch Set 1: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/647835. |
Message from Go LUCI: Patch Set 1: This CL has failed the run. Reason: Tryjob golang/try/gotip-js-wasm has failed with summary (view all results):
Build or test failure, click here for results. To reproduce, try Additional links for debugging: Please don’t reply on this GitHub thread. Visit golang.org/cl/647835. |
Message from Go LUCI: Patch Set 1: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/647835. |
Message from Jorropo: Patch Set 1: Commit-Queue+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/647835. |
Message from Go LUCI: Patch Set 1: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2025-02-07T23:34:35Z","revision":"fefb5f95a8096b1567fa78c9caff39cec65fc44f"} Please don’t reply on this GitHub thread. Visit golang.org/cl/647835. |
Message from Jorropo: Patch Set 1: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/647835. |
Message from Go LUCI: Patch Set 1: This CL has failed the run. Reason: Tryjob golang/try/gotip-js-wasm has failed with summary (view all results):
Build or test failure, click here for results. To reproduce, try Additional links for debugging: Please don’t reply on this GitHub thread. Visit golang.org/cl/647835. |
improve JPEG decoder performance by about 10-14% on most
architectures by unrolling unzig and shift-clamp loops.
The trade-off is ~16KiB additional binary size.