Closed
Bug 1194651
Opened 9 years ago
Closed 9 years ago
[Performance] Improve Video app startup time to less than 1000ms
Categories
(Firefox OS Graveyard :: Gaia::Video, defect)
Tracking
(tracking-b2g:+)
RESOLVED
INCOMPLETE
tracking-b2g | + |
People
(Reporter: bobby.chien+bugzilla, Assigned: kanru)
References
Details
(Whiteboard: [perf-wanted])
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Comment 1•9 years ago
|
||
Report: 2015/08/18
Flame-KK 319MB
-------------------------
appName master v2.2
-------- ------ ----
Messages 1545 986
Settings 2669 2437
Video 1182 1020
Gallery 1139 1046
Music 1054 956
FM Radio 741 496
E-Mail 547 1973
Contacts 1149 717
Clock 1395 1206
Calendar 1543 1342
Camera 1465 1297
Dialer 769
Aries-KK 2G
----------------------------------------------------------------------
appName value memory device branch context
-------- ----- ------ ------ ------ -----------------------------
Calendar 730 2048 aries master calendar.gaiamobile.org
Contacts 565 2048 aries master communications.gaiamobile.org
FM Radio 349 2048 aries master fm.gaiamobile.org
E-Mail 250 2048 aries master email.gaiamobile.org
Music 511 2048 aries master music.gaiamobile.org
Clock 518 2048 aries master clock.gaiamobile.org
Camera 651 2048 aries master camera.gaiamobile.org
Dialer 305 2048 aries master communications.gaiamobile.org
Video 710 2048 aries master video.gaiamobile.org
Settings 1657 2048 aries master settings.gaiamobile.org
Gallery 507 2048 aries master gallery.gaiamobile.org
Messages 778 2048 aries master sms.gaiamobile.org
Reporter | ||
Comment 2•9 years ago
|
||
Need profiling data to follow up.
Assignee: nobody → kchen
tracking-b2g:
--- → +
Assignee | ||
Comment 3•9 years ago
|
||
Profile result https://people.mozilla.org/~bgirard/cleopatra/#report=85f71f0732eeaf669fa588f82417aefc04cf89b3
We can see from firstLoadURI to visuallyLoaded about 1.7s we could split it to six big chunks:
0. 206ms Some random stuff. Some nsIApplication activity is notable.
1. 363ms Loading JavaScript and running it. I don't know what gaia_build_defer_index.js is for yet.
2. 172ms Still running script and gaia_build_defer_index.js again. Looks like gaia header because I saw runFontFitSoon
3. 349ms Received something from XHR and started to process it. Looks like l10n because I saw onL10nLoaded()
4. 344ms Idle and refresh triggered by vsync, probably waiting DeviceStorage or IDB response
5. 154ms Received result from IDB and starting to add video thumbnails to the list.
Above six sums up to 1588ms total.
Assignee | ||
Comment 4•9 years ago
|
||
One block is 191ms of sync ipc message IPDL::PHal::SendGetCurrentSwitchState. Filed bug 1197689.
Assignee | ||
Comment 5•9 years ago
|
||
https://people.mozilla.org/~bgirard/cleopatra/#report=d022fd8c5ab70e0fea4c34d6d77e667bea6c9e8f&filter=[{%22type%22%3A%22RangeSampleFilter%22,%22start%22%3A68080,%22end%22%3A69084}]&selection=0,1014,4
New profile after fixing AudioChannelManager and removing gaia-header.
We could find
1. IndexedDB and DeviceStorage initialization is delayed by b2g main thread by about 150ms. If we could make the mozbrowserloadend handling less heavy we might reduce this part.
2. We still spent about 200ms parsing and run JavaScript. Maybe we could lazyload more js file we might reduce this part.
3. Populating thumbnail list takes about 130ms. No idea off hand how to improve this.
4. After recv LoadURL we spent about 200ms doing something before we start parsing index.html and scripts. Not sure where to optimize yet.
Reporter | ||
Comment 6•9 years ago
|
||
coldlaunch.visuallyLoaded
-------------------------
appName master v2.2
-------- ------ ----
Video 1258 1020
----------------------------------------------------------------------
appName value memory device branch context
-------- ----- ------ ------ ------ -----------------------------
Video 696 2048 aries master video.gaiamobile.org
Reporter | ||
Updated•9 years ago
|
Component: General → Gaia::Video
Reporter | ||
Updated•9 years ago
|
Whiteboard: [perf-wanted][Profile-wanted] → [perf-wanted]
Comment 7•9 years ago
|
||
I see some action items can be done from gaia:
1. Initialize mediaDB as early as possible
2. Use gaia-header optimizations like bug 1198132
Flags: needinfo?(rnicoletti)
Comment 8•9 years ago
|
||
(In reply to Ting-Yu Chou [:ting] from comment #7)
> I see some action items can be done from gaia:
>
> 1. Initialize mediaDB as early as possible
As I explained in bug 1210860 [1], initDB() is being called as early in the startup process as it can be -- as soon as we get the `mozL10n.once` callback. It can't be called before then as the db initialization process displays localized text in some circumstances.
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1210860#c23
> 2. Use gaia-header optimizations like bug 1198132
I will make these changes and test to see what performance impact there is.
Have you discussed this bug with Ting? It seems this bug and bug 1210860 are very similar.
Flags: needinfo?(rnicoletti)
Comment 9•9 years ago
|
||
This is a patch that adds the gaia-header optimizations like bug 1198132. In my testing, I didn't see a significant performance improvement. Perhaps you can test it also.
Comment 10•9 years ago
|
||
With attachment 8675191 [details] [diff] [review], I can see >70ms from running gaia-header font fit before visuallyLoaded is gone.
[1] Before: http://people.mozilla.org/~bgirard/cleopatra/#report=8c6f92fc1dafeed2340a52858b7145678f96c253&search=gaia-header
[2] After: http://people.mozilla.org/~bgirard/cleopatra/#report=105ee7ad9bba7c235ea768fda958e991272dd979&search=gaia-header
Comment 11•9 years ago
|
||
(In reply to Ting-Yu Chou [:ting] from comment #10)
> With attachment 8675191 [details] [diff] [review], I can see >70ms from
> running gaia-header font fit before visuallyLoaded is gone.
>
> [1] Before:
> http://people.mozilla.org/~bgirard/cleopatra/
> #report=8c6f92fc1dafeed2340a52858b7145678f96c253&search=gaia-header
> [2] After:
> http://people.mozilla.org/~bgirard/cleopatra/
> #report=105ee7ad9bba7c235ea768fda958e991272dd979&search=gaia-header
Note the profiles were captured on an Aries.
Reporter | ||
Updated•9 years ago
|
Blocks: AppStartup
Comment 12•9 years ago
|
||
(In reply to Russ Nicoletti [:russn] from comment #8)
> (In reply to Ting-Yu Chou [:ting] from comment #7)
> > I see some action items can be done from gaia:
> >
> > 1. Initialize mediaDB as early as possible
>
> As I explained in bug 1210860 [1], initDB() is being called as early in the
> startup process as it can be -- as soon as we get the `mozL10n.once`
> callback. It can't be called before then as the db initialization process
> displays localized text in some circumstances.
In theory, you can launch initDB before l10n is done if you guard the displaying function to make sure that it is fired only after l10n is ready.
So instead:
l10n.ready then initDB then display
initDB then l10n.ready then display
It should be faster because initDB and l10n will be parallelized.
Reporter | ||
Comment 13•9 years ago
|
||
Please reopen if you need.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•