Closed Bug 1152836 Opened 11 years ago Closed 11 years ago

WiFi auth scanner is slow

Categories

(Firefox OS Graveyard :: Developer Tools, defect)

defect
Not set
normal

Tracking

(firefox40 fixed)

RESOLVED FIXED
Tracking Status
firefox40 --- fixed

People

(Reporter: jryans, Assigned: jryans)

References

(Blocks 1 open bug)

Details

Attachments

(7 files, 1 obsolete file)

39 bytes, text/x-review-board-request
past
: review+
Details
39 bytes, text/x-review-board-request
past
: review+
Details
39 bytes, text/x-review-board-request
past
: review+
Details
39 bytes, text/x-review-board-request
past
: review+
Details
39 bytes, text/x-review-board-request
past
: review+
Details
39 bytes, text/x-review-board-request
past
: review+
Details
39 bytes, text/x-review-board-request
past
: review+
Details
At the moment, the QR recognition cycle is extremely long on devices. On the Flame, it takes roughly 20s to recognize an image. The current code is not optimized at all. I have several patches that will bring this down to the 1.5s range.
Attached file MozReview Request: bz://1152836/jryans (obsolete) —
/r/6815 - Bug 1152836 - QR Decoder: Cache imagedata.data: 915ms -> 750ms r=past /r/6817 - Bug 1152836 - QR Decoder: Remove QR namespace (image, h/w): 750ms -> 580ms r=past /r/6819 - Bug 1152836 - QR Decoder: Let everywhere, style nits: 580ms -> 400ms r=past /r/6821 - Bug 1152836 - QR Decoder: Remove getPixel bounds check: 400ms -> 335ms r=past /r/6823 - Bug 1152836 - QR Decoder: Add 32bit buffer: 335ms -> 256ms r=past /r/6825 - Bug 1152836 - QR Decoder: Grayscale clamped array: 256ms -> 235ms r=past /r/6827 - Bug 1152836 - QR Decoder: Inline getPixel: 235ms -> 225ms r=past Pull down these commits: hg pull -r 2c0d3ca7200fba5b3ec46a8f6c31d5c4b5a20fdf https://reviewboard-hg.mozilla.org/gecko/
Attachment #8590552 - Flags: review?(past)
Panos, here a bunch of micro-optimizations for the QR decoder library we used on devices. On desktop, everything added together brings about 4x improvement (915ms -> 225ms). On the Flame, it's more like 13x improvement (20000ms -> 1500ms), which make the scanner much more usable! While toiling in the library, I've seen several other possible optimizations, but these seem like enough to worry about for now.
https://reviewboard.mozilla.org/r/6819/#review5731 Ship It! ::: toolkit/devtools/qrcode/decoder/index.js (Diff revision 1) > - return this.errorCorrectionLevel.ordinal() << 3 | dataMask; > + return this.errorCorrectionLevel.ordinal() << 3 | this.dataMask; Whoa! ::: toolkit/devtools/qrcode/decoder/index.js (Diff revision 1) > - var eval = poly.evaluateAt(this.field.exp(dataMatrix ? i + 1 : i)); > - syndromeCoefficients[syndromeCoefficients.length - 1 - i] = eval; > - if (eval != 0) { > + let value = poly.evaluateAt(this.field.exp(dataMatrix ? i + 1 : i)); > + syndromeCoefficients[syndromeCoefficients.length - 1 - i] = value; > + if (value !== 0) { Geez!
Comment on attachment 8590552 [details] MozReview Request: bz://1152836/jryans https://reviewboard.mozilla.org/r/6813/#review5741 Nice! I take it we don't expect to pick up changes from upstream very often, right?
Attachment #8590552 - Flags: review?(past) → review+
(In reply to Panos Astithas [:past] from comment #11) > Comment on attachment 8590552 [details] > MozReview Request: bz://1152836/jryans > > https://reviewboard.mozilla.org/r/6813/#review5741 > > Nice! I take it we don't expect to pick up changes from upstream very often, > right? No, the last change was 2014-01-09 (~15 months ago). It's basically a port of Java code from even longer ago, I think. So, anyway, I think we are fine to diverge as needed.
Assignee: nobody → jryans
Attachment #8590552 - Attachment is obsolete: true
Attachment #8620000 - Flags: review+
Attachment #8620001 - Flags: review+
Attachment #8620002 - Flags: review+
Attachment #8620003 - Flags: review+
Attachment #8620004 - Flags: review+
Attachment #8620005 - Flags: review+
Attachment #8620006 - Flags: review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: