Closed
Bug 858454
Opened 12 years ago
Closed 12 years ago
mozKeyboard.sendKey takes more than 10ms
Categories
(Firefox OS Graveyard :: Gaia::Keyboard, defect)
Tracking
(firefox21 wontfix, firefox22 wontfix, firefox23 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix)
RESOLVED
FIXED
B2G C4 (2jan on)
People
(Reporter: vingtetun, Assigned: gal)
References
Details
Attachments
(1 file, 3 obsolete files)
1.77 KB,
patch
|
gal
:
review+
gal
:
approval-gaia-v1+
|
Details | Diff | Splinter Review |
Calling mozKeyboard.sendKey cost a bit more than 10ms in the click method of the latin.js. This is likely before a call to this API fire synchronously 3 calls to nsIDOMWindowUtils.sendKeyEvent that triggers a widget->dispatchEvent.
I don't know if those calls are synced or not?
A simple "fix" is to wrap the API call into a setTimeout(..., 0) so it does not block user actions and will be postpone when there is some times on the event loop.
A smarter fix could be to do that inside the mozKeyboard.sendKey code.
The right fix involves understanding is widget->dispatchEvent is sync or not and in this case I still believe that setTimeout(..., 0) is not that bad.The main issue here being that the keyboard lives on the main thread and the mozKeyboard api is not e10s ready.
Assignee | ||
Comment 1•12 years ago
|
||
Yep, those calls are sync because they return whether you took the default action.
Assignee | ||
Comment 2•12 years ago
|
||
Assignee: nobody → gal
Assignee | ||
Comment 3•12 years ago
|
||
Attachment #734287 -
Attachment is obsolete: true
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #734289 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Attachment #734290 -
Flags: review?(fabrice)
Attachment #734290 -
Flags: review?(21)
Assignee | ||
Comment 5•12 years ago
|
||
Please steal and land when you r+. Thanks!
Comment 6•12 years ago
|
||
Comment on attachment 734290 [details] [diff] [review]
send keyboard events from the event loop, one by one, to avoid hogging the event loop for too long
Review of attachment 734290 [details] [diff] [review]:
-----------------------------------------------------------------
lgtm, but I did not run any timing to check if we get the improvements we expect.
Attachment #734290 -
Flags: review?(fabrice) → review+
Assignee | ||
Comment 7•12 years ago
|
||
Attachment #734290 -
Attachment is obsolete: true
Attachment #734290 -
Flags: review?(21)
Attachment #734341 -
Flags: review+
Assignee | ||
Comment 8•12 years ago
|
||
Comment 9•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 10•12 years ago
|
||
Comment on attachment 734341 [details] [diff] [review]
tested version with a few fixes, carrying forward r=fabrice
I tested this on device and this definitely feels more performant so I think we should take this for v1.1
Attachment #734341 -
Flags: approval-gaia-v1+
Updated•12 years ago
|
Whiteboard: checkin-needed
Comment 11•12 years ago
|
||
I assume that was meant to be an approval-b2g18?
Comment 12•12 years ago
|
||
status-b2g18:
--- → fixed
status-b2g18-v1.0.0:
--- → wontfix
status-b2g18-v1.0.1:
--- → wontfix
status-firefox21:
--- → wontfix
status-firefox22:
--- → wontfix
status-firefox23:
--- → fixed
Whiteboard: checkin-needed
Target Milestone: --- → B2G C4 (2jan on)
You need to log in
before you can comment on or make changes to this bug.
Description
•