[Contacts] Defer scripts where possible

RESOLVED FIXED in Firefox OS v1.2

Status

Firefox OS
Gaia::Contacts
P1
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: kgrandon, Assigned: kgrandon)

Tracking

({perf})

unspecified
1.2 C2(Oct11)
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

(blocking-b2g:koi+, b2g-v1.2 fixed)

Details

(Whiteboard: [c= p=2 s=2013.10.04 u=1.2])

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Non-deferred scripts may block with the HTML parser, we should defer them where possible.
(Assignee)

Comment 1

5 years ago
Created attachment 808645 [details]
Github pull request
(Assignee)

Comment 2

5 years ago
Comment on attachment 808645 [details]
Github pull request

Hey - could one of you guys review this quick patch? Thanks!
Attachment #808645 - Flags: review?(francisco.jordano)
Attachment #808645 - Flags: review?(21)
Hi Kevin,

this is a bit weird for me, the scripts already include the |defer| attribute, is there any bug that prevent the script to be deferred for having |type| attribute?

Maybe I'm missing something :S
Flags: needinfo?(kgrandon)
(Assignee)

Comment 4

5 years ago
(In reply to Francisco Jordano [:arcturus] from comment #3)
> Hi Kevin,
> 
> this is a bit weird for me, the scripts already include the |defer|
> attribute, is there any bug that prevent the script to be deferred for
> having |type| attribute?
> 
> Maybe I'm missing something :S

Hi Francisco,

Sorry or the confusing pull request! The defer attribute was added to l10n and l10n_date libraries. The type attribute was removed becuase it is not needed. These are two conventions that we use in other Gaia apps. This should result in a tiny perf boost. Let me know of you have any other questions, thanks!
Flags: needinfo?(kgrandon)
Comment on attachment 808645 [details]
Github pull request

Thanks Kevin!
Attachment #808645 - Flags: review?(francisco.jordano) → review+
(Assignee)

Comment 6

5 years ago
Thanks for the quick reviews! Landed in master: https://github.com/mozilla-b2g/gaia/commit/30115b14062c39443528ab8c9a79e7f424178e36
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
(Assignee)

Updated

5 years ago
Whiteboard: [c= p=2 s= u=] → [c= p=2 s=2013.10.04 u=]
For what its worth, I was concerned that this might have caused an extra reflow, so I took a couple profiles:

Before:

  http://people.mozilla.org/~bgirard/cleopatra/#report=0bfe988bac496ba7a7e09f8cc2e3623099ca0afe

After:

  http://people.mozilla.org/~bgirard/cleopatra/#report=cc2f0dacb5a5f188c21ea1b2d08631dfd98190e2

I don't see any reflow regression.  As expected the static loading in html5::RunFlushLoop() improved from 400+ms to ~350ms.

Just including the profiles here in case anyone wants to look at them.
(Assignee)

Comment 8

5 years ago
Thanks for the profiles Ben!
Awesome :)

Thanks for the info Ben
Uplifted 30115b14062c39443528ab8c9a79e7f424178e36 to:
v1.2: 96f48b5e0acc8bee3303f0569b699494b06586ab
status-b2g-v1.2: --- → fixed

Updated

5 years ago
Target Milestone: --- → 1.2 C2(Oct11)

Updated

5 years ago
Whiteboard: [c= p=2 s=2013.10.04 u=] → [c= p=2 s=2013.10.04 u=1.2]
You need to log in before you can comment on or make changes to this bug.