Closed Bug 1220186 Opened 9 years ago Closed 6 years ago

The homescreen generates many reflows

Categories

(Firefox OS Graveyard :: Gaia::Homescreen, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: gmarty, Unassigned)

References

Details

(Whiteboard: [systemsfe])

Attachments

(1 obsolete file)

When the homescreen starts about 200+ reflows take place. The progressive icons loading mechanism is bound to create reflows, but let's see what we can optimise to reduce their number.
Whiteboard: [systemsfe]
Comment on attachment 8681334 [details] [review]
[gaia] gmarty:Bug-1220186-The-homescreen-generates-many-reflows > mozilla-b2g:master

This bug remove the _relayout method of gaia-site-icon. Let's first see if the tests are green and let's measure the impact of the patch.
Chris, how does the code look to you?
Attachment #8681334 - Flags: feedback?(chrislord.net)
Comment on attachment 8681334 [details] [review]
[gaia] gmarty:Bug-1220186-The-homescreen-generates-many-reflows > mozilla-b2g:master

I'm guessing this isn't the whole thing? this._size is used pretty extensively around gaia-site-icon, just removing that would break a lot of things I think.

(but I'm very much in favour of removing it and relying on CSS here)
Attachment #8681334 - Flags: feedback?(chrislord.net)
Blocks: 1215553
Blocks: 1220725
Blocks: 1217217
I'm on PTO for the next 2 weeks, can you take a look?
Getting the size of the img container must be done only once for all icons. That means that this must be done at the homescreen level and then be propagated to all icons.
Also ideally, we want to measure the performance before and after the patch, but using the JS profiler I noticed a massive ~5% improvement on start time.
Flags: needinfo?(chrislord.net)
I may have improved this in bug 1224136 - the changes made have knocked nearly 2 seconds off the fullyLoaded time, but I still think there's a lot of room for improvement (all the same, we're now very close to verticalhome's fullyLoaded time and considerably better than its visuallyLoaded, so it's looking much better!)

Going to move the needinfo back to gmarty to confirm if this has helped in this regard, or if there is still much we can do.
Flags: needinfo?(chrislord.net) → needinfo?(gmarty)
Thanks Chris, things are much better now. Fixing these reflows was a low hanging fruit.
Digging into the current state of the home screen, I noticed some more reflows (though they don't harm performance as much as the one fixed in bug 1224136).
The pattern is repeated about 15 times (more on 4 cols) and consists of a reflow caused by App#refreshGridSize() then followed by 5 to 20 reflows caused by gaia-container synchroniseMaster().
That said, according to the profiler, I doubt we could get better than a few hundreds of ms.
I leave it to you Chris to take the final decision about whether this refactoring/fixing is worth it.
Flags: needinfo?(gmarty) → needinfo?(chrislord.net)
Attachment #8681334 - Attachment is obsolete: true
I think it's worth refactoring/streamlining to eliminate more of these reflows, but it's not urgent. Let's leave this open to track the issue.
Flags: needinfo?(chrislord.net)
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: