Closed Bug 1143580 Opened 9 years ago Closed 6 years ago

gaia-header.js takes time during application startup (>100ms)

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: ting, Unassigned)

References

Details

Though there're some improvments from bug 1089920, but still gaia-header.js takes time during application startup. I got following numbers from the profiles at 20150312 with the code I updated that day, sorry but I lost the revisions.

+----------+-----------------------------+-----------------------------+
|          | Flame-kk-v2.2 319MB         | Flame-kk-master 319MB       |
+----------+-----------------------------+-----------------------------+
| SMS      | ~130ms http://goo.gl/UeKnXu | ~155ms http://goo.gl/cuA6QD |
| Music    | ~210ms http://goo.gl/456nMy | ~170ms http://goo.gl/MMRRPg |
| Gallery  | ~260ms http://goo.gl/krbRc0 | ~205ms http://goo.gl/peSjoQ |
| Contacts | ~255ms http://goo.gl/AR6xHw | ~390ms http://goo.gl/N90gsd |
+----------+-----------------------------+-----------------------------+

One thing need to clarify at first is how much of those are happened before visuallyLoaded.
(this is really bug 1112131)
See Also: 10899201112131
Based on what have been gained on Contacts recently [1], I wonder do we want to revisit bug 1102154 which cache calculation results in local storage or similiar idea for further improvement.

[1] http://ferjm.ghost.io/improving-fxos-contacts-app-performance/
I'm still not convinced by such an idea but we can try.
ServiceWorker is also an option.
Two profiles with stackwalk on Flame kk master:

Contacts: http://people.mozilla.org/~bgirard/cleopatra/#report=e83d37d2d4d94a6cb8e48bf207ce60f3f7ae7e4b
Gallery: http://people.mozilla.org/~bgirard/cleopatra/#report=1d91e707b87f8892ea02111f2fc8e3521e005b75

The most noticed samples are: sumButtonWidths(), createdCallback(), and getTextWidth().
Depends on: 1147328
Only SMS and Music uses no-font-fit and title-start/end, we should use the tweaks for the others.
Depends on: 1198132
See Also: → 1203464
Do we really need to adjust the font size per buttons' width? Can't it be consistent? Do user expect font size changing when buttons altered?
This is what UX wants.

In the SMS app where the size of the buttons are fixed, we could use title-start/title-end attribute to workaround it (see [1]). But it's easier if we don't do it when we can have reflows that are not costly.

[1] https://github.com/gaia-components/gaia-header/#optimizing-with-title-start--title-end
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.