perf: use direct gradient decode path in SingleGradientOnly#738
Merged
veluca93 merged 1 commit intoApr 13, 2026
Merged
Conversation
Benchmark @ a006d4dComparing: 7cf3a662 (Base) vs 9e878745 (PR)
|
9c8585e to
a006d4d
Compare
Member
Performance Summary (Commit
|
| Machine | Threading | Base MP/s | Head MP/s | Avg Improvement |
|---|---|---|---|---|
| desktop | Single | 84.24 | 83.82 | -0.19% ± 0.21% |
| desktop | Multi | 84.18 | 84.10 | -0.09% ± 0.16% |
| framework-desktop | Single | 103.79 | 102.43 | -0.96% ± 0.17% |
| framework-desktop | Multi | 103.75 | 103.37 | -0.59% ± 0.17% |
| pixel7a | Single (Fast) | 34.57 | 33.65 | -1.46% ± 0.69% |
| pixel7a | Single (Mid) | 24.78 | 24.90 | +0.04% ± 0.17% |
| pixel7a | Multi | 34.19 | 33.63 | -1.18% ± 0.27% |
lilith
added a commit
to imazen/zenjxl-decoder
that referenced
this pull request
Jun 1, 2026
…jxl-rs#738) SingleGradientOnly::decode_one called Predictor::Gradient.predict_one (enum dispatch) then make_pixel(dec, 1, pred) (an i64 multiply by 1). For this single-predictor tree both reduce to clamped_gradient(left, top, topleft) and dec.wrapping_add(pred as i32) respectively. Output is bit-identical (verified against predict.rs:332 and common.rs:86-88); the inline drops the dispatch and multiply from a hot modular-decode loop. Upstream change by Helmut Januschka.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carved out from the ongoing perf/autoresearch stream after PR #705 split work.
Change:
SingleGradientOnly::decode_one, use directclamped_gradient + wrapping_addinstead of routing through the generic predictor helper path.Why: