Closed
Bug 1157908
Opened 8 years ago
Closed 8 years ago
Lower the priority of Gecko thread Looper messages
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox40 fixed)
RESOLVED
FIXED
Firefox 40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: jchen, Assigned: jchen)
Details
Attachments
(2 files, 1 obsolete file)
2.82 KB,
patch
|
snorp
:
review+
|
Details | Diff | Splinter Review |
20.16 KB,
patch
|
jchen
:
review+
|
Details | Diff | Splinter Review |
Right now, for every loop of the main Gecko thread event loop, we pump the Looper message loop once. This effectively gives Looper messages the same priority as Gecko events. Considering we only need to process Looper messages in rare cases, I think we are pumping the message loop unnecessarily. Moving the PumpMessageLoop call to nsAppShell::ProcessNextNativeEvent would reduce unnecessary calls.
Assignee | ||
Comment 1•8 years ago
|
||
Call pumpMessageLoop only when we don't have other events, rather than with every iteration of the event loop. I don't think it will have that big of an effect, but it's nice to have.
Attachment #8596834 -
Flags: review?(snorp)
Assignee | ||
Comment 2•8 years ago
|
||
I also took some time to optimize pumpMessageLoop a bit. Before, C++ was calling pumpMessageLoop in Java through JNI, but pumpMessageLoop has to go back and call getNextMessageFromQueue in C++ through JNI again. This patch makes us cache the necessary Java references in AndroidBridge, so that we only have to cross the JNI boundary once.
Attachment #8596837 -
Flags: review?(snorp)
Comment on attachment 8596834 [details] [diff] [review] Give Gecko thread Looper low priority (v1) Review of attachment 8596834 [details] [diff] [review]: ----------------------------------------------------------------- I think Flash was (is) the only thing that ever used the Looper on the Gecko thread, but this seems fine.
Attachment #8596834 -
Flags: review?(snorp) → review+
Attachment #8596837 -
Flags: review?(snorp) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/7164a2488b28 https://hg.mozilla.org/integration/mozilla-inbound/rev/a486dcc9c233
Comment 5•8 years ago
|
||
Backed out for various Android test failures. https://hg.mozilla.org/integration/mozilla-inbound/rev/6d0fb655e2e6 https://treeherder.mozilla.org/logviewer.html#?job_id=9281105&repo=mozilla-inbound was permafailing since this landed. There were failures in other chunks that looked related as well.
Comment 6•8 years ago
|
||
Various IPC crashes on debug builds too. Basically, make sure it's very green on Try before attempting to land again :)
Assignee | ||
Comment 7•8 years ago
|
||
Added AndroidBridge null-check.
Attachment #8596837 -
Attachment is obsolete: true
Attachment #8598350 -
Flags: review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/cad4ead8fc88 https://hg.mozilla.org/integration/mozilla-inbound/rev/a2619dca0a16
Comment 9•8 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/cad4ead8fc88 https://hg.mozilla.org/mozilla-central/rev/a2619dca0a16
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 40
Updated•2 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•