Closed
Bug 735636
Opened 13 years ago
Closed 13 years ago
PromptService list view has bad scroll performance
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox13 fixed, firefox14 fixed, blocking-fennec1.0 +)
VERIFIED
FIXED
Firefox 14
People
(Reporter: lucasr, Assigned: lucasr)
References
Details
(Keywords: perf)
Attachments
(4 files, 4 obsolete files)
4.80 KB,
text/html
|
Details | |
7.72 KB,
patch
|
wesj
:
review+
akeybl
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
3.92 KB,
patch
|
wesj
:
review+
akeybl
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
3.57 KB,
patch
|
wesj
:
review+
akeybl
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
It should be using convertView correctly (avoids inflating every row) and using a viewholder pattern to avoid calling findViewById too often.
Updated•13 years ago
|
blocking-fennec1.0: --- → ?
Comment 1•13 years ago
|
||
You mean select for helper popups like this one: http://people.mozilla.org/~mwargers/tests/forms/select/selectoptions_alot.html
Comment 2•13 years ago
|
||
How bad is scroll performance? How big of a list?
Comment 3•13 years ago
|
||
On the Asus Transformer TF101 tablet, I've seen it causing the "Appliction doesn not respond, close it?" dialog to appear, while scrolling in the select form helper popup on the testcase.
Assignee | ||
Comment 4•13 years ago
|
||
(In reply to Mark Finkle (:mfinkle) from comment #2)
> How bad is scroll performance? How big of a list?
It's not necessarily related to the size of the list. Basically, ListView recycles a lot of views while scrolling and the ListView adapter used in PromptService is not using the recycled view (aka convertView) and inflating rows on every getView() call.
It should be straightforward to change PromptService to use convertView and ViewHolder pattern.
Updated•13 years ago
|
Assignee: nobody → lucasr.at.mozilla
blocking-fennec1.0: ? → +
Assignee | ||
Comment 5•13 years ago
|
||
Attachment #607945 -
Flags: review?(wjohnston)
Assignee | ||
Comment 6•13 years ago
|
||
Attachment #607946 -
Flags: review?(wjohnston)
Assignee | ||
Comment 7•13 years ago
|
||
Attachment #607947 -
Flags: review?(wjohnston)
Comment 8•13 years ago
|
||
Comment on attachment 607945 [details] [diff] [review]
(1/3) Correctly use recycled view and apply ViewHolder pattern
Review of attachment 607945 [details] [diff] [review]:
-----------------------------------------------------------------
Sounds like (from irc), we need to tweak this a bit.
::: mobile/android/base/PromptService.java
@@ +490,5 @@
> + if (convertView == null) {
> + int resourceId = mResourceId;
> + if (item.isGroup) {
> + resourceId = R.layout.list_item_header;
> + }
Docs say "Note: You should check that this view is non-null and of an appropriate type before using." How do we know whether the convertView we get is a header row or not? I guess we need to inform the Adapter of how many row types we have? I'll throw up a demo with a lot of rows including some header ones.
Attachment #607945 -
Flags: review?(wjohnston) → review-
Comment 9•13 years ago
|
||
This is just a long multiple select list with header rows scattered throughout.
Comment 10•13 years ago
|
||
Comment on attachment 607947 [details] [diff] [review]
(3/3) Factor out checked state update into separate method
Review of attachment 607947 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/base/PromptService.java
@@ +509,5 @@
> + private void maybeUpdateCheckedState(int position, PromptListItem item, TextView t) {
> + if (item.isGroup)
> + return;
> +
> + CheckedTextView ct = (CheckedTextView) t;
I'm not sure all of these are checkedTextViews (i.e. context menus). Return if this is null, but I have a feeling it will actually throw instead and the gigantic try catch I had before was saving us, so we might be better to do a fancier check.... (I like instanceOf, but blassey tells me if you're using instanceOf, you're doing it wrong)
Assignee | ||
Comment 12•13 years ago
|
||
(In reply to Wesley Johnston (:wesj) from comment #10)
> Comment on attachment 607947 [details] [diff] [review]
> (3/3) Factor out checked state update into separate method
>
> Review of attachment 607947 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: mobile/android/base/PromptService.java
> @@ +509,5 @@
> > + private void maybeUpdateCheckedState(int position, PromptListItem item, TextView t) {
> > + if (item.isGroup)
> > + return;
> > +
> > + CheckedTextView ct = (CheckedTextView) t;
>
> I'm not sure all of these are checkedTextViews (i.e. context menus). Return
> if this is null, but I have a feeling it will actually throw instead and the
> gigantic try catch I had before was saving us, so we might be better to do a
> fancier check.... (I like instanceOf, but blassey tells me if you're using
> instanceOf, you're doing it wrong)
IIUC, the view will always be a CheckedTextView if it's not a group because we're using Android's select_dialog_multichoice and select_dialog_singlechoice layout.
Assignee | ||
Comment 13•13 years ago
|
||
Attachment #610062 -
Flags: review?(wjohnston)
Assignee | ||
Updated•13 years ago
|
Attachment #607945 -
Attachment is obsolete: true
Assignee | ||
Comment 14•13 years ago
|
||
Attachment #610063 -
Flags: review?(wjohnston)
Assignee | ||
Updated•13 years ago
|
Attachment #607946 -
Attachment is obsolete: true
Attachment #607946 -
Flags: review?(wjohnston)
Assignee | ||
Comment 15•13 years ago
|
||
Attachment #610064 -
Flags: review?(wjohnston)
Assignee | ||
Updated•13 years ago
|
Attachment #607947 -
Attachment is obsolete: true
Attachment #607947 -
Flags: review?(wjohnston)
Updated•13 years ago
|
Attachment #610062 -
Flags: review?(wjohnston) → review+
Updated•13 years ago
|
Attachment #610063 -
Flags: review?(wjohnston) → review+
Comment 16•13 years ago
|
||
Comment on attachment 610064 [details] [diff] [review]
(3/3) Factor out checked state update into separate method
Review of attachment 610064 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/base/PromptService.java
@@ +530,5 @@
> + private void maybeUpdateCheckedState(int position, PromptListItem item, TextView t) {
> + if (item.isGroup)
> + return;
> +
> + CheckedTextView ct = (CheckedTextView) t;
Context menus use android.R.layout.select_dialog_item which I don't think is a CheckedTextView.
Attachment #610064 -
Flags: review?(wjohnston) → review-
Assignee | ||
Comment 17•13 years ago
|
||
Attachment #610181 -
Flags: review?(wjohnston)
Assignee | ||
Updated•13 years ago
|
Attachment #610064 -
Attachment is obsolete: true
Updated•13 years ago
|
Attachment #610181 -
Flags: review?(wjohnston) → review+
Comment 18•13 years ago
|
||
Make sure you've tested this with some different select type popups and context menus!
Assignee | ||
Comment 19•13 years ago
|
||
Comment 20•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/96fcc34dbbc9
https://hg.mozilla.org/mozilla-central/rev/bb20be085b35
https://hg.mozilla.org/mozilla-central/rev/130e702908ca
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 14
Assignee | ||
Comment 21•13 years ago
|
||
Comment on attachment 610062 [details] [diff] [review]
(1/3) Correctly use recycled view and apply ViewHolder pattern
Mobile only. Release blocker.
Attachment #610062 -
Flags: approval-mozilla-aurora?
Assignee | ||
Comment 22•13 years ago
|
||
Comment on attachment 610063 [details] [diff] [review]
(2/3) Factor out icon update into separate method
Mobile only. Release blocker.
Attachment #610063 -
Flags: approval-mozilla-aurora?
Assignee | ||
Comment 23•13 years ago
|
||
Comment on attachment 610181 [details] [diff] [review]
Factor out checked state update into separate method
Mobile only. Release blocker.
Attachment #610181 -
Flags: approval-mozilla-aurora?
Comment 24•13 years ago
|
||
Regarding testcase http://people.mozilla.org/~mwargers/tests/forms/select/selectoptions_alot.html
This seems definitely fixed to me in yesterday's trunk build on the Samsung Galaxy Nexus.
Status: RESOLVED → VERIFIED
Comment 25•13 years ago
|
||
Comment on attachment 610062 [details] [diff] [review]
(1/3) Correctly use recycled view and apply ViewHolder pattern
[Triage Comment]
Mobile only & blocking Fennec 1.0. Approved for Aurora 13.
Attachment #610062 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #610063 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #610181 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 26•13 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/a6515bb070f4
https://hg.mozilla.org/releases/mozilla-aurora/rev/c2ababf0ea20
https://hg.mozilla.org/releases/mozilla-aurora/rev/c883b789280f
status-firefox13:
--- → fixed
status-firefox14:
--- → fixed
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•