Last Comment Bug 708394 - Avoid LayoutInflater in constructors
: Avoid LayoutInflater in constructors
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: unspecified
: x86 Mac OS X
P1 normal (vote)
: ---
Assigned To: Sriram Ramasubramanian [:sriram]
: Sebastian Kaspari (:sebastian)
Depends on:
  Show dependency treegraph
Reported: 2011-12-07 13:08 PST by Sriram Ramasubramanian [:sriram]
Modified: 2012-01-09 15:09 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch (19.10 KB, patch)
2011-12-07 15:30 PST, Sriram Ramasubramanian [:sriram]
mark.finkle: review+
Details | Diff | Splinter Review

Description User image Sriram Ramasubramanian [:sriram] 2011-12-07 13:08:33 PST
Using LayoutInflater will increase the time to load the UI. The same functionality can be used with <include/> and onFinishInflate(). It's better to remove the LayoutInflater used at various places.
Comment 1 User image Mark Finkle (:mfinkle) (use needinfo?) 2011-12-07 15:06:28 PST
This will help startup time
Comment 2 User image Sriram Ramasubramanian [:sriram] 2011-12-07 15:30:00 PST
Created attachment 579872 [details] [diff] [review]

This patches uses <include/> and removes the LayoutInflation from most places.
While using profiler, I saw some performance win. Generally there is around 50-150ms faster UI on Nexus S and 5-20ms faster UI on Nexus.

The "onFinishInflate()" is called twice in pre-Honeycomb (or pre-ICS) phones -- reported here:

I have a guard for the same.
Comment 3 User image Mark Finkle (:mfinkle) (use needinfo?) 2011-12-08 13:51:11 PST
Comment 4 User image Ed Morley [:emorley] 2011-12-09 06:54:19 PST

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