Repository navigation
Reduce managed coupon barcode decoding CPU and latency - #547
Merged
Merged
Conversation
Read cropped and rotated luminance through shared pixel views and vectorize the ZXing row threshold while preserving scalar behavior. Run crop attempts with per-worker readers bounded by Environment.ProcessorCount and retain the original success priority. Add fallback, concurrent-recognition, and patterned-image coverage. Include attribution for the adapted ZXing threshold algorithm.
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.
The managed barcode fallback repeatedly copies and rotates overlapping image regions. Use shared luminance views and SIMD row binarization to reduce that work, then decode independent crops with separate readers and a concurrency limit derived from
Environment.ProcessorCount. The full-image fast path and original first-success crop priority are preserved; CPUs without SIMD use the scalar path.In an isolated ARM64 comparison on one difficult image, five warmed paired runs reduced median managed-fallback time from 3.17 s to 1.27 s (60%) and process CPU time from 2.72 s to 1.58 s (42%). This is a targeted benchmark, not a production-wide latency estimate.
Validation:
Recognition outputs are preserved, including existing limitations. The adapted ZXing threshold algorithm includes its attribution and Apache license.