Closed Bug 1362224 Opened 7 years ago Closed 7 years ago

Speed up setting *Action icon images during tab switch

Categories

(WebExtensions :: Frontend, defect)

defect
Not set
normal

Tracking

(firefox54 wontfix, firefox55 fixed)

RESOLVED FIXED
mozilla55
Tracking Status
firefox54 --- wontfix
firefox55 --- fixed

People

(Reporter: kmag, Assigned: kmag)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

Selecting the icon and generating the CSS for these can be pretty expensive. We should try to cache both rather than recalculate them for every navigation and/or tab switch.
Comment on attachment 8864972 [details]
Bug 1362224: Cache per-tab icon data for browserAction/pageAction.

https://reviewboard.mozilla.org/r/136632/#review139738
Attachment #8864972 - Flags: review?(aswan) → review+
Comment on attachment 8864974 [details]
Bug 1362224: Speed up permission checks a bit.

https://reviewboard.mozilla.org/r/136636/#review139740
Attachment #8864974 - Flags: review?(aswan) → review+
Comment on attachment 8864978 [details]
Bug 1362224: Cached normalized object for simple icon URLs.

https://reviewboard.mozilla.org/r/136638/#review139744

::: toolkit/components/extensions/ExtensionUtils.jsm:326
(Diff revision 1)
>  }
>  
>  // Manages icon details for toolbar buttons in the |pageAction| and
>  // |browserAction| APIs.
>  let IconDetails = {
> +  iconCache: new DefaultWeakMap(() => new Map()),

add a comment documenting the structure please.
Attachment #8864978 - Flags: review?(aswan) → review+
Comment on attachment 8864982 [details]
Bug 1362224: Cache tab incognito state.

https://reviewboard.mozilla.org/r/136644/#review139748
Attachment #8864982 - Flags: review?(aswan) → review+
Comment on attachment 8864973 [details]
Bug 1362224: requestAnimationFrame before changing browserAction/pageAction buttons.

https://reviewboard.mozilla.org/r/136634/#review139752

r=me with the `promiseAnimationFrame()` changes we discussed on IRC
Attachment #8864973 - Flags: review?(aswan) → review+
Comment on attachment 8864972 [details]
Bug 1362224: Cache per-tab icon data for browserAction/pageAction.

Approval Request Comment
[Feature/Bug causing the regression]: N/A
[User impact if declined]: This patch improves tab switch performance when WebExtension pageAction or browserAction buttons are active. Since Screenshots uses a browserAction button, this should help offset the performance impact of enabling it in 54.
[Is this code covered by automated tests?]: Yes
[Has the fix been verified in Nightly?]: No
[Needs manual test from QE? If yes, steps to reproduce]: N/A
[List of other uplifts needed for the feature/fix]: None
[Is the change risky?]: Low-risk
[Why is the change risky/not risky?]: The changes are fairly simple, and should only risk affecting add-ons with per-tab pageAction and browserAction icons, which are relatively rare.
[String changes made/needed]: None
Attachment #8864972 - Flags: approval-mozilla-beta?
Comment on attachment 8864974 [details]
Bug 1362224: Speed up permission checks a bit.

Approval Request Comment
[Feature/Bug causing the regression]: N/A
[User impact if declined]: This should speed up a number of operations in WebExtension code, and should help mitigate the performance impact of enabling Screenshots in beta.
[Is this code covered by automated tests?]: Yes
[Has the fix been verified in Nightly?]: N/A
[Needs manual test from QE? If yes, steps to reproduce]: N/A
[List of other uplifts needed for the feature/fix]: None
[Is the change risky?]: No.
[Why is the change risky/not risky?]: This is a very simple change which replaces a fairly expensive operation with an cheaper equivalent.
[String changes made/needed]: None.
Attachment #8864974 - Flags: approval-mozilla-beta?
Blocks: 1356243
Blocks: webext-perf
Screenshots will go live in Fx55 so we don't have to uplift these patches in 54. Beta54-. Mark 54 won't fix.
Attachment #8864972 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
Attachment #8864974 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
Depends on: 1373331
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: