Closed
Bug 841353
Opened 12 years ago
Closed 12 years ago
'defer' more scripts
Categories
(Firefox OS Graveyard :: Gaia, defect)
Tracking
(blocking-b2g:tef+, b2g18+ fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 fixed)
RESOLVED
FIXED
blocking-b2g | tef+ |
People
(Reporter: vingtetun, Unassigned)
References
Details
(Keywords: verifyme, Whiteboard: [FFOS_perf] QARegressExclude)
Attachments
(2 files, 3 obsolete files)
26.99 KB,
patch
|
etienne
:
review+
akeybl
:
approval-mozilla-b2g18+
|
Details | Diff | Splinter Review |
1.34 KB,
patch
|
etienne
:
review+
akeybl
:
approval-mozilla-b2g18+
|
Details | Diff | Splinter Review |
In many apps more scripts can be defered in order to take advantage of the html5 parser.
Attachment #713889 -
Flags: review?(etienne)
Reporter | ||
Comment 1•12 years ago
|
||
I forgot some debugging statements...
Assignee: nobody → 21
Attachment #713889 -
Attachment is obsolete: true
Attachment #713889 -
Flags: review?(etienne)
Attachment #713890 -
Flags: review?(etienne)
Comment 2•12 years ago
|
||
Can you rebase your patch? I'd like to do a bit a testing and it's not applying properly.
Reporter | ||
Comment 3•12 years ago
|
||
Attachment #713890 -
Attachment is obsolete: true
Attachment #713890 -
Flags: review?(etienne)
Attachment #713907 -
Flags: review?
Reporter | ||
Updated•12 years ago
|
Attachment #713907 -
Flags: review? → review?(etienne)
Reporter | ||
Updated•12 years ago
|
blocking-b2g: --- → tef?
Reporter | ||
Comment 4•12 years ago
|
||
Less forgotten things.
Attachment #713907 -
Attachment is obsolete: true
Attachment #713907 -
Flags: review?(etienne)
Attachment #713940 -
Flags: review?(etienne)
Comment 5•12 years ago
|
||
Comment on attachment 713940 [details] [diff] [review]
Patch v2
Review of attachment 713940 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with the changes to the fm app removed (since they break the app ;) )
Attachment #713940 -
Flags: review?(etienne) → review+
Reporter | ||
Comment 6•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
What's the expected perf win for this? Which apps should be improved?
Reporter | ||
Comment 8•12 years ago
|
||
(In reply to Chris Jones [:cjones] [:warhammer] from comment #7)
> What's the expected perf win for this? Which apps should be improved?
The win depends on the app. If you look at datazilla you will see an improvement for gallery/music/sms between https://github.com/mozilla-b2g/gaia/commit/2e4d862b5592e1a3 and https://github.com/mozilla-b2g/gaia/commit/a09de87ea2be9cc0 which I would associate to this PR. The theory I have is that instead of blocking on the main thread for reading scripts and then parse the html, the parser parse the html on it's own thread as soon as possible and scripts are parsed on the main thread in parralel.
Reporter | ||
Comment 9•12 years ago
|
||
I add an additional space somewhere and the browser is broken in production mode now :(
Attachment #714333 -
Flags: review?(etienne)
Updated•12 years ago
|
Attachment #714333 -
Flags: review?(etienne) → review+
Reporter | ||
Comment 10•12 years ago
|
||
Comment 11•12 years ago
|
||
(In reply to Vivien Nicolas (:vingtetun) (:21) from comment #10)
> https://github.com/mozilla-b2g/gaia/commit/
> 83ea6d7a59071369376be9ef9b4b397a378dc18a
Not blocking, but we will approve this change for v1-train and v1.0.1.
blocking-b2g: tef? → -
tracking-b2g18:
--- → +
Updated•12 years ago
|
Attachment #713940 -
Flags: approval-mozilla-b2g18+
Updated•12 years ago
|
Attachment #714333 -
Flags: approval-mozilla-b2g18+
Comment 12•12 years ago
|
||
Henri wrote the HTML 5 parser, so I'm wondering if comment 8 sound right to him...
(In reply to Vivien Nicolas (:vingtetun) (:21) from comment #8)
> The theory I have is that instead of blocking on the
> main thread for reading scripts and then parse the html, the parser parse
> the html on it's own thread as soon as possible and scripts are parsed on
> the main thread in parralel.
The parser thread keeps parsing on its own thread in any case. Normal <script> doesn't block the parser thread. It blocks DOM construction on the main thread. Meanwhile, the parser thread keeps parsing and generating a sequence of operations that need to be performed for DOM construction later. The sequence of operations can be used unless the script does an unbalanced document.write() (unbalanced meaning that it opens a different number of elements than it closes).
Defer runs scripts after DOM construction. The JS source is parsed at that point, so there isn't HTML parsing and JS parsing parallelism is the defer case. The main benefit compared to putting a normal <script> at the bottom of the HTML source is that the network fetch can start sooner.
Note that there's also the option to run scripts as soon as they are available, but that's the async attribute rather than the defer attribute.
Comment 14•12 years ago
|
||
Ask john for for uplift
status-b2g18-v1.0.1:
--- → affected
Flags: needinfo?(jhford)
Comment 15•12 years ago
|
||
Marking tef+ since that is what's needed at this stage to get uplift to v1-train *and* v1.0.1
Comment 16•12 years ago
|
||
Commit 83ea6d7a59071369376be9ef9b4b397a378dc18a does not apply to v1-train or v1.0.1.
This means that there are merge conflicts which need to be resolved.
If there are dependencies that are not
approved for branch landing, or have yet to land on master,
please let me know
If a manual merge is required, a good place to start might be:
cd gaia
git checkout v1-train
git cherry-pick -x -m1 83ea6d7a59071369376be9ef9b4b397a378dc18a
<RESOLVE MERGE CONFLICTS>
git checkout v1.0.1
git cherry-pick -x $(git log -n1 v1-train)
Flags: needinfo?(jhford)
Comment 17•12 years ago
|
||
Bug 837267 is producing this conflict.
While it should be easy to merge, I'd rather uplift that low-risk bug too and I accordingly asked an approval there.
Comment 18•12 years ago
|
||
If Bug 837267 is not approved on v1.0.1 then we could easily resolve the conflict.
Comment 19•12 years ago
|
||
(In reply to Julien Wajsberg [:julienw] from comment #18)
> If Bug 837267 is not approved on v1.0.1 then we could easily resolve the
> conflict.
Okay, please do this as uplifting bug 837267 was deemed unnecessary risk during the triage meeting today (the day of 1.0.1 handoff).
Comment 20•12 years ago
|
||
see https://github.com/julienw/gaia/tree/841353-resolve-conflict for v1.0.1
for v1-train I believe bug 837267 will ultimately land so we can wait for that.
Comment 21•12 years ago
|
||
v1.0.1: bc34b39420a3d16b50fe70ed4d3641dc6ebfea09
Comment 22•12 years ago
|
||
Per comment 20, which refers to something which did land on v1-train, setting status-b2g18 to wontfix
Comment 23•12 years ago
|
||
Sorry if that wasn't clear.
I wanted to mean that when Bug 837267 will be landed to v1-train, this one could land to v1-train without conflict.
I think this happened now so you can proceed, thanks a lot John !
Comment 24•12 years ago
|
||
Still having a merge conflict on v1-train with:
git checkout v1-train
git cherry-pick -x -m1 83ea6d7a59071369376be9ef9b4b397a378dc18a
# both modified: apps/browser/index.html
<!-- Shared code -->
++<<<<<<< HEAD
+ <script type="application/javascript" src="shared/js/l10n.js"></script>
+ <script type="application/javascript" defer src="shared/js/gesture_detector.js"></script>
++=======
+ <script defer src="shared/js/l10n.js"></script>
+ <script defer src="shared/js/gesture_detector.js"></script>
+
+ <!-- Specific code -->
+ <script defer src="js/places.js"></script>
+ <script defer src="js/date_helper.js"></script>
+ <script defer src="js/modal_dialog.js"></script>
+ <script defer src="js/authentication_dialog.js"></script>
+ <script defer src="js/browser.js"></script>
+ <script defer src="js/browser_extensions.js"></script>
++>>>>>>> 83ea6d7... Merge pull request #8132 from vingtetun/841353-followup
<!-- Resources -->
Flags: needinfo?(felash)
Comment 25•12 years ago
|
||
John, there are 2 commits here :
https://github.com/mozilla-b2g/gaia/commit/88568d9f69edf0fcb7c59613f961b8804f1eaa88
https://github.com/mozilla-b2g/gaia/commit/83ea6d7a59071369376be9ef9b4b397a378dc18a
I think you only tried to cherry-pick the second one.
Flags: needinfo?(felash)
Comment 26•12 years ago
|
||
(In reply to Julien Wajsberg [:julienw] from comment #25)
> John, there are 2 commits here :
>
> https://github.com/mozilla-b2g/gaia/commit/
> 88568d9f69edf0fcb7c59613f961b8804f1eaa88
> https://github.com/mozilla-b2g/gaia/commit/
> 83ea6d7a59071369376be9ef9b4b397a378dc18a
>
> I think you only tried to cherry-pick the second one.
you are correct, I did only try the second one.
Comment 27•12 years ago
|
||
Squashed the commits:
v1-train: a3e3407f867980178a31262a6893fbf2ee22f636
Comment 28•12 years ago
|
||
Just saw that I messed up in comment 20 : I only used the second commit.
Just tried to cherry pick the first commit too (88568d9f69edf0fcb7c59613f961b8804f1eaa88) and there are conflicts. I try to sort this out.
Comment 29•12 years ago
|
||
v1.0.1: c342bb232e46bb88714ead96e2401f5815f3ea67
sorry for the mess.
Comment 31•12 years ago
|
||
Can you please provide steps to verify this fix - as we will blackbox test from the UI?
Comment 32•12 years ago
|
||
Nothing much to verify, except that the various affected apps still work.
Maybe check that they load in less than 1 sec.
Affected apps are :
browser
calendar
camera
clock
communications (dialer, contacts, ftu, facebook import)
fm
gallery
music
sms
video
Updated•12 years ago
|
Whiteboard: [FFOS_perf] → [FFOS_perf] QARegressExclude
Updated•12 years ago
|
Whiteboard: [FFOS_perf] QARegressExclude → [FFOS_perf] QARegressExclude, [qa-]
Updated•12 years ago
|
Assignee: 21 → nobody
Keywords: verifyme
QA Contact: jhammink
Whiteboard: [FFOS_perf] QARegressExclude, [qa-] → [FFOS_perf] QARegressExclude
You need to log in
before you can comment on or make changes to this bug.
Description
•