Closed Bug 1402182 Opened 7 years ago Closed 3 years ago

onMeasure called a ridiculous number of times (~16 in ActivityStreamPanel?)

Categories

(Firefox for Android Graveyard :: General, defect, P5)

All
Android
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: mcomella, Unassigned)

References

Details

STR (requires dev env)
1) Override onMeasure in ActivityStreamPanel
2) Add a statement in there (such as a log) and add a breakpoint on that statement
3) Start fennec in debug mode

Expected: onMeasure called a few times
Actual: onMeasure called ~16 times? I didn't count all of them.

This seems ridiculous and could have a non-neglible perf impact. liuche's Moto X was really slow to open Activity Stream and I wonder if this large amount of layout calls, in combination with doing background queries for the data, is why.

That being said, it really only matters if users see a difference so perhaps start by investigating that.

Assuming the code hasn't changed since these bugs were filed, RelativeLayouts are notorious for requiring two measures and our top-level container is a RelativeLayout (yay!): bug 1107636. We also have an inner layout which is a RelativeLayout: bug 1223053. This could explain a few of the measures.

I also wonder if Activity Stream is making us measure additional times because of how we change the child view layout params during onBind and onSizeChanged. It'd be interesting to compare the number of measure calls on startup when changing what the default home panel is.
That being said, I only assume onMeasure being called so many times is irregular – I wouldn't know for sure.
[triage] Bulk edit from title: this is a non-critical issue or [meta] bug.
Priority: -- → P3
Re-triaging per https://bugzilla.mozilla.org/show_bug.cgi?id=1473195

Needinfo :susheel if you think this bug should be re-triaged.
Priority: P3 → P5
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.