Only update commands once per tab switch

RESOLVED FIXED in Firefox 55

Status

()

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: enndeakin, Assigned: enndeakin)

Tracking

(Depends on 1 bug, Blocks 1 bug)

unspecified
mozilla55
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Posted file Possible patch (obsolete) —
When switching tabs and doing other tasks, commands can be updated several times due to focus shifting around.

However, we could instead queue up requests to update commands until the tab switch is finished, preventing unnecessary work.

On my machine this appeared to save about 1ms per tab switch although I only tested my hand.
See Also: → 1356587
The included test shows that command updates are reduced from 4 to 1 during a tab switch.
Assignee: nobody → enndeakin
Attachment #8855813 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8861909 - Flags: review?(mconley)
Comment on attachment 8861909 [details] [diff] [review]
Reduce updates during tab switch

Review of attachment 8861909 [details] [diff] [review]:
-----------------------------------------------------------------

I like it! Thanks!

::: browser/base/content/test/tabs/browser_tabswitch_updatecommands.js
@@ +1,1 @@
> +add_task(function* () {

Can you please add "use strict" at the top, and a short header comment describing what the test is testing?
Attachment #8861909 - Flags: review?(mconley) → review+
Pushed by neil@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1cd959bc881b
add a queue-up mechanism to command dispatchers that lets updates be queued up so that duplicates can be removed. Use this for tab switching to reduce the number of extraneous command updates that occur, r=mconley
https://hg.mozilla.org/mozilla-central/rev/1cd959bc881b
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Depends on: 1361484
You need to log in before you can comment on or make changes to this bug.