perf(scale): optimize ScaleImage with precomputed weights and slice access#32
Closed
simonCatBot wants to merge 3 commits into
Closed
perf(scale): optimize ScaleImage with precomputed weights and slice access#32simonCatBot wants to merge 3 commits into
simonCatBot wants to merge 3 commits into
Conversation
added 2 commits
May 14, 2026 00:17
…ccess - Add scale_image_nearest() with precomputed source x positions - Add scale_image_bilinear() with Q8 fixed-point weights - Wire fast paths in vxu_scale_image_impl for full-region U8 images - Avoid per-pixel f32 math in hot loops
- Phase: use f32 atan2 instead of f64, direct slice access for S16 data - NonLinearFilter: fast path for 3x3 all-ones mask with Min/Max/Median sorting network - Add NonLinearMode enum and nonlinear_filter_3x3 to kernel_fast_paths
bd2dfcf to
029e4b6
Compare
simonCatBot
pushed a commit
to simonCatBot/rustVX
that referenced
this pull request
May 14, 2026
…lter fast paths Move fast-path dispatch logic into kernel_fast_paths.rs thin wrappers so vxu_impl.rs only adds ~13 lines total. Avoids .text bloat that caused Subtract (0.648x) and Phase (0.808x) regressions in perf gate. - try_scale_image_fast() — 1-line call in vxu_scale_image_impl - try_phase_fast() — 3-line call in phase_s16 - try_nonlinear_filter_3x3_fast() — 4-line call in vxu_non_linear_filter_impl All fast paths still gated on Gray format, full valid rect, non-Constant border, and (for non-linear) 3x3 all-ones mask.
Collaborator
Author
|
Superseded by the approach in PR #34 (now closed). The original branch has build issues (duplicate median9 definition) and the clean rebase also hit perf gate layout shift problems. Will batch these optimizations into a future mega-PR. |
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.
Optimizes ScaleImage_Half and ScaleImage_Double for AMD EPYC Zen 3.
Changes:
Benchmarks (expected from PR #31 baseline):
Testing: