Last Comment Bug 721216 - Bitmap compression on main thread causes the tab strip to take a long time to appear
: Bitmap compression on main thread causes the tab strip to take a long time to...
: perf
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: unspecified
: ARM Android
: -- normal (vote)
: Firefox 12
Assigned To: Brad Lassey [:blassey] (use needinfo?)
: Sebastian Kaspari (:sebastian)
: 720361 (view as bug list)
Depends on: 721308
  Show dependency treegraph
Reported: 2012-01-25 14:38 PST by Patrick Walton (:pcwalton)
Modified: 2016-07-29 14:21 PDT (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (2.32 KB, patch)
2012-01-25 15:36 PST, Brad Lassey [:blassey] (use needinfo?)
pwalton: review+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Patrick Walton (:pcwalton) 2012-01-25 14:38:14 PST
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
Comment 1 Brad Lassey [:blassey] (use needinfo?) 2012-01-25 15:36:51 PST
Created attachment 591638 [details] [diff] [review]
Comment 2 Patrick Walton (:pcwalton) 2012-01-25 18:56:11 PST
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.
Comment 3 Patrick Walton (:pcwalton) 2012-01-25 18:58:04 PST
Comment on attachment 591638 [details] [diff] [review]

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


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

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

nit: {}
Comment 4 Brad Lassey [:blassey] (use needinfo?) 2012-01-25 23:54:28 PST
Comment 5 Ed Morley [:emorley] 2012-01-26 04:26:51 PST
Comment 6 Brad Lassey [:blassey] (use needinfo?) 2012-01-26 10:26:06 PST
*** Bug 720361 has been marked as a duplicate of this bug. ***
Comment 7 Brad Lassey [:blassey] (use needinfo?) 2012-01-26 20:38:19 PST
Comment on attachment 591638 [details] [diff] [review]

[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.
Comment 8 Alex Keybl [:akeybl] 2012-01-27 16:33:31 PST
Comment on attachment 591638 [details] [diff] [review]

[Triage Comment]
Mobile only - approved for Aurora.
Comment 9 Brad Lassey [:blassey] (use needinfo?) 2012-01-30 11:36:14 PST

Note You need to log in before you can comment on or make changes to this bug.