Bitmap compression on main thread causes the tab strip to take a long time to appear

RESOLVED FIXED in Firefox 11

Status

()

Firefox for Android
General
RESOLVED FIXED
5 years ago
10 months ago

People

(Reporter: pcwalton, Assigned: blassey)

Tracking

({perf})

unspecified
Firefox 12
ARM
Android
Points:
---

Firefox Tracking Flags

(firefox11 fixed, firefox12 fixed, fennec11+)

Details

(Whiteboard: [inbound])

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
It can take a few seconds for the tabs to appear when the tab strip button is tapped. This is due to this call stack:

* Bitmap.nativeCompress
* Bitmap.compress
* GeckoApp.getAndProcessThumbnailForTab
* Tabs.refreshThumbnails
* TabsTray.onCreate
Created attachment 591638 [details] [diff] [review]
patch
Attachment #591638 - Flags: review?(pwalton)
(Reporter)

Comment 2

5 years ago
This helps significantly. It still takes too long to open the tab strip (about a second), and switching tabs takes a long time as well, but those are separate bugs.
(Reporter)

Comment 3

5 years ago
Comment on attachment 591638 [details] [diff] [review]
patch

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

r=me.

But can we put image decoding in a background thread so that it doesn't block the UI at all?

::: mobile/android/base/Tabs.java
@@ +221,5 @@
> +        GeckoAppShell.getHandler().post(new Runnable() {
> +            public void run() {
> +                Iterator<Tab> iterator = tabs.values().iterator();
> +                while (iterator.hasNext())
> +                    GeckoApp.mAppContext.getAndProcessThumbnailForTab(iterator.next());

nit: {}
Attachment #591638 - Flags: review?(pwalton) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/7f26e362a9f7
tracking-fennec: --- → 11+
Whiteboard: [inbound]
https://hg.mozilla.org/mozilla-central/rev/7f26e362a9f7
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 12
(Assignee)

Updated

5 years ago
Duplicate of this bug: 720361
Comment on attachment 591638 [details] [diff] [review]
patch

[Approval Request Comment]
Regression caused by (bug #): 
User impact if declined: 
Tab menu opens slowly
Testing completed (on m-c, etc.): 
Risk to taking this patch (and alternatives if risky):
This patch depends on bug 721308 since it is possible to cause a crash with it alone. With both patches this is pretty safe.
Attachment #591638 - Flags: approval-mozilla-aurora?
(Assignee)

Updated

5 years ago
Depends on: 721308

Comment 8

5 years ago
Comment on attachment 591638 [details] [diff] [review]
patch

[Triage Comment]
Mobile only - approved for Aurora.
Attachment #591638 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
https://hg.mozilla.org/releases/mozilla-aurora/rev/75bb8908cef0
status-firefox11: --- → fixed
status-firefox12: --- → fixed
You need to log in before you can comment on or make changes to this bug.