Use jar reordering with core apps packages

RESOLVED FIXED

Status

Firefox OS
General
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: fabrice, Assigned: fabrice)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 3 obsolete attachments)

(Assignee)

Description

5 years ago
This is an experiment to see if reordering application packages helps with startup time.
(Assignee)

Comment 1

5 years ago
Created attachment 707454 [details] [diff] [review]
gecko patch v1
Assignee: nobody → fabrice
(Assignee)

Comment 2

5 years ago
Created attachment 707455 [details] [diff] [review]
gaia patch v1

To set up everything properly, apply the patches, and flash a VARIANT=user build.

Then run these steps:
- in gaia, make start-reorder
- launch all the apps on the phone that you want to preload
- in gaia, make stop-reorder
- in gaia, PRODUCTION=1 make production
(Assignee)

Comment 3

5 years ago
Chris, do you mind running your timing tests with these?
Flags: needinfo?(jones.chris.g)
mwu, can you help measure this.
Flags: needinfo?(jones.chris.g) → needinfo?(mwu)

Comment 5

5 years ago
I started with trying to get a measure of how much IO contributes to the startup time, but startup time seems to massively vary regardless of whether we have hot or cold caches. I'll try measuring with reordered jars but I doubt we can see much improvement if a hot cache doesn't necessary give us better startup..
Flags: needinfo?(mwu)
What steps are you using to test?  What app are you testing?

Comment 7

5 years ago
I updated gecko and changed my testing procedure a bit, and the numbers are a lot less noisy now. Email had a difference of ~130ms between hot and cold startup, and clock had a difference of ~200ms. However, even after reordering, the startup times did not seem to change much.
(Assignee)

Updated

5 years ago
Whiteboard: [FFOS_perf]
Whiteboard: [FFOS_perf]
(Assignee)

Comment 8

4 years ago
So I revisited that technique and results are pretty different, probably because gaia apps moved from loading a few big files to loading a lot of small ones and it's more important to reorder.

On a tarako, cold launch of the settings apps drops from ~2000ms to ~1720ms - a huge gain for "just" some build time machinery.

Yuren, let's work on that next week together!
(Assignee)

Comment 9

4 years ago
Created attachment 8373219 [details] [review]
Gaia PR for v1.3t
Attachment #707454 - Attachment is obsolete: true
Attachment #707455 - Attachment is obsolete: true
Attachment #8373219 - Flags: review?(yurenju.mozilla)
(Assignee)

Comment 10

4 years ago
Created attachment 8373220 [details] [diff] [review]
gonk-misc patch

Michael, this change to b2g.sh let us restart in jar reordering logging mode by setting a temporary property. Looks cleaner to me than to pull/push b2g.sh to add the export on the fly.
Attachment #8373220 - Flags: review?(mwu)
(Assignee)

Comment 11

4 years ago
Created attachment 8373756 [details] [diff] [review]
reorder-b2g-sh.patch

Updated according to irc discussion.
Attachment #8373220 - Attachment is obsolete: true
Attachment #8373220 - Flags: review?(mwu)
Attachment #8373756 - Flags: review?(mwu)

Comment 12

4 years ago
Comment on attachment 8373756 [details] [diff] [review]
reorder-b2g-sh.patch

Review of attachment 8373756 [details] [diff] [review]:
-----------------------------------------------------------------

r=me on the jar part

::: /home/fabrice/dev/tarako/gonk-misc/b2g.sh
@@ -4,4 @@
>  mkdir -p $TMPDIR
>  chmod 1777 $TMPDIR
>  ulimit -n 8192
> -export MOZ_CRASHREPORTER=1

?
Attachment #8373756 - Flags: review?(mwu) → review+
Comment on attachment 8373219 [details] [review]
Gaia PR for v1.3t

r=yurenju and please add a space around | for this line:
> APPS=`cut -f 1 -d ' ' jarloader.log |sort -u|grep gaiamobile| cut -c 8-`

for 1.3t we can land this patch but for master we should rewrite optimizejar.py in javascript. 

do you think we need a follow up bug to rewrite in javascript for master or just trace it in this bug?
Attachment #8373219 - Flags: review?(yurenju.mozilla) → review+
(Assignee)

Comment 15

4 years ago
Thanks Yuren! We should definitely do the js rewrite in another bug.
(Assignee)

Comment 17

4 years ago
log files on 1.3t:
https://github.com/mozilla-b2g/gaia/commit/56bd97aef3e453a008ee2c1908dce16e7afd127e
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Depends on: 974769

Updated

4 years ago
Blocks: 991459
You need to log in before you can comment on or make changes to this bug.