Closed
Bug 1304883
Opened 9 years ago
Closed 9 years ago
Reduce MainThreadInvoker latency
Categories
(Core :: Widget: Win32, defect)
Tracking
()
RESOLVED
FIXED
mozilla52
| Tracking | Status | |
|---|---|---|
| firefox52 | --- | fixed |
People
(Reporter: bugzilla, Assigned: bugzilla)
References
Details
Attachments
(1 file)
|
9.00 KB,
patch
|
jimm
:
review+
|
Details | Diff | Splinter Review |
Since a11y+e10s is using ALPC, we want the handoff from the background RPC thread to the main thread to be done as cheaply as possible, thus ensuring that we don't lose performance due to the handoff.
Posting runnables to the main thread to execute NtTestAlert adds too much latency to MainThreadInvoker as it needs to take two mutexes and then go through the Windows message queue to get that call inserted.
I've been able to improve a11y+e10s performance scores on both Talos and locally by modifying this code so that, once an APC has been enqueued, we set an atomic boolean. Whenever the widget is about to do a PeekMessage, or whenever an APC has woken the widget from a wait, we check that flag and, if it was set, we then clear the entire APC queue.
| Assignee | ||
Comment 1•9 years ago
|
||
Comment 2•9 years ago
|
||
Comment on attachment 8793947 [details] [diff] [review]
Patch
Review of attachment 8793947 [details] [diff] [review]:
-----------------------------------------------------------------
::: widget/windows/WinUtils.cpp
@@ +723,5 @@
> UINT aLastMessage, UINT aOption)
> {
> +#ifdef ACCESSIBILITY
> + if (NS_IsMainThread() && sAPCPending.exchange(false)) {
> + while (sNtTestAlert() != STATUS_SUCCESS) ;
why do we need to call this repetitively?
Attachment #8793947 -
Flags: review?(jmathies) → review+
| Assignee | ||
Comment 3•9 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #2)
> why do we need to call this repetitively?
NtTestAlert doesn't clear out the entire APC queue, just the head. If there is more than one APC we want to service all of them.
| Assignee | ||
Comment 4•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/c9e65e3bf84a6229e79c1a0246a99b54a426f262
Bug 1304883: Modify mscom::MainThreadInvoker and Win32 widget to use atomic boolean to flag pending APCs; r=jimm
Comment 5•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in
before you can comment on or make changes to this bug.
Description
•