Closed Bug 1776205 Opened 2 years ago Closed 2 years ago

Use concurrent delazification for inline scripts too.

Categories

(Core :: JavaScript Engine, enhancement)

enhancement

Tracking

()

RESOLVED INCOMPLETE
Tracking Status
firefox103 --- disabled
firefox104 --- disabled
firefox105 --- affected

People

(Reporter: nbp, Assigned: nbp)

References

(Blocks 1 open bug)

Details

(Keywords: perf-alert)

Attachments

(1 file)

Currently we only apply delazification strategies to script which are compiled asynchronously. Knowing that concurrent delazification is capable of starting off-thread delazification running concurrently with the main thread to race the delazification of functions, we should also enable it for inline scripts as well.

This patch move the ShouldApplyDelazificationStartegy as well as the
ApplyDelazificationStrategy under FillCompileOptionsForRequest.

As not all delazification strategies are capable of handling modules yet (Bug
1760334), and do not apply to cached-stencil, we have to add extra filters to
prevent ShouldApplyDelazificationStrategy to access custom delazification mode.

Pushed by npierron@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a411b158a51e
Set the delazify option in all ScriptLoader code paths. r=arai
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
Regressions: 1776521
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
Flags: needinfo?(nicolas.b.pierron)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 103 Branch → ---

(In reply to Cristina Cozmuta (:CrissCozmuta) from comment #5)

Backout for causing ccov failures (bug 1776521). CLOSED TREE

Backout link : https://hg.mozilla.org/integration/autoland/rev/00f6e6609ff99d876d48e40245684d9f6cf2d5f2

== Change summary for alert #34673 (as of Wed, 29 Jun 2022 13:03:32 GMT) ==

Regressions:

Ratio Test Platform Options Absolute values (old vs new)
195% google-docs fcp macosx1015-64-shippable-qr fission warm webrender 110.00 -> 324.62
186% google-docs FirstVisualChange macosx1015-64-shippable-qr fission warm webrender 123.33 -> 353.33
44% google-slides FirstVisualChange linux1804-64-shippable-qr fission warm webrender 425.00 -> 610.00
31% google-slides SpeedIndex linux1804-64-shippable-qr fission warm webrender 570.12 -> 744.67
29% google-slides PerceptualSpeedIndex linux1804-64-shippable-qr fission warm webrender 588.33 -> 760.75
26% google-slides ContentfulSpeedIndex linux1804-64-shippable-qr fission warm webrender 648.88 -> 815.75
23% google-docs ContentfulSpeedIndex macosx1015-64-shippable-qr fission warm webrender 745.50 -> 916.58
13% google-docs PerceptualSpeedIndex macosx1015-64-shippable-qr fission warm webrender 817.00 -> 924.42
6% amazon-search loadtime android-hw-a51-11-0-aarch64-shippable-qr warm webrender 987.58 -> 1,048.50
4% amazon-search loadtime android-hw-p2-8-0-android-aarch64-shippable-qr warm webrender 639.68 -> 667.04

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
18% expedia ContentfulSpeedIndex linux1804-64-shippable-qr cold fission webrender 556.04 -> 453.42
12% cnn fcp macosx1015-64-shippable-qr fission warm webrender 300.71 -> 264.42
11% cnn FirstVisualChange macosx1015-64-shippable-qr fission warm webrender 320.00 -> 283.33
11% google-docs-canvas loadtime linux1804-64-shippable-qr cold fission webrender 1,929.29 -> 1,718.58
11% google-docs-canvas loadtime windows10-64-shippable-qr cold fission webrender 1,798.33 -> 1,607.25
... ... ... ... ...
3% cnn loadtime linux1804-64-shippable-qr cold fission webrender 1,366.48 -> 1,327.88

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=34673

Depends on: 1776668
Depends on: 1776521

(In reply to Cristina Cozmuta (:CrissCozmuta) from comment #5)

Backout for causing ccov failures (bug 1776521). CLOSED TREE

Backout link : https://hg.mozilla.org/integration/autoland/rev/00f6e6609ff99d876d48e40245684d9f6cf2d5f2

== Change summary for alert #34699 (as of Thu, 30 Jun 2022 23:08:41 GMT) ==

Regressions:

Ratio Test Platform Options Absolute values (old vs new)
373% perf_reftest slow-selector-2.html linux1804-64-shippable-qr e10s fission stylo webrender-sw 0.01 -> 0.04
315% perf_reftest only-children-1.html linux1804-64-shippable-qr e10s fission stylo webrender-sw 0.01 -> 0.05
300% perf_reftest_singletons slow-selector-2.html linux1804-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
300% perf_reftest_singletons slow-selector-2.html macosx1015-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
290% perf_reftest display-none-1.html linux1804-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.06
283% perf_reftest_singletons slow-selector-1.html windows10-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
282% perf_reftest display-none-1.html linux1804-64-shippable-qr e10s fission stylo webrender-sw 0.02 -> 0.07
269% perf_reftest_singletons only-children-1.html macosx1015-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
269% perf_reftest_singletons slow-selector-1.html linux1804-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
265% perf_reftest_singletons only-children-1.html windows10-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
... ... ... ... ...
233% perf_reftest display-none-1.html linux1804-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.05
229% perf_reftest_singletons slow-selector-1.html macosx1015-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
203% perf_reftest_singletons display-none-1.html windows10-64-shippable-qr e10s fission stylo webrender 0.03 -> 0.08
159% perf_reftest_singletons display-none-1.html macosx1015-64-shippable-qr e10s fission stylo webrender 0.03 -> 0.08
141% perf_reftest_singletons display-none-1.html linux1804-64-shippable-qr e10s fission stylo webrender 0.03 -> 0.08

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=34699

The performance issue came from the fact that the previous patch changed the inline script to change the on-demand delazification which only apply to inline scripts to the delazification strategy defined by the about:config toggle.

I updated the patch such that it rejects setting parsing everything eagerly when dealing with inline scripts.
So the delazification strategy for inline scripts will take the delazification strategy defined in about:config, and switch back to on-demand if the preference is set to parsing everything eagerly.

The other issue is with code coverage, which is skipped by checking if the delazification strategy is already set to full-parse, in which case we discard the use of the delazification strategy preference.

Flags: needinfo?(nicolas.b.pierron)
Pushed by npierron@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/84c72c2fbfd6
Set the delazify option in all ScriptLoader code paths. r=arai
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch

== Change summary for alert #34779 (as of Tue, 12 Jul 2022 00:29:31 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
75% perf_reftest_singletons only-children-1.html macosx1015-64-shippable-qr e10s fission stylo webrender 0.08 -> 0.02
75% perf_reftest_singletons only-children-1.html windows10-64-shippable-qr e10s fission stylo webrender 0.08 -> 0.02
74% perf_reftest_singletons only-children-1.html linux1804-64-shippable-qr e10s fission stylo webrender 0.08 -> 0.02
73% perf_reftest_singletons slow-selector-1.html macosx1015-64-shippable-qr e10s fission stylo webrender 0.08 -> 0.02
73% perf_reftest_singletons slow-selector-2.html windows10-64-shippable-qr e10s fission stylo webrender 0.07 -> 0.02
... ... ... ... ...
55% perf_reftest_singletons display-none-1.html windows10-64-shippable-qr e10s fission stylo webrender 0.07 -> 0.03

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=34779

No longer depends on: 1776668
Regressions: 1780426

(In reply to Dianna Smith [:diannaS] from comment #13)

Backout for causing (bug 1780426) in fx104, it remains in fx105

Are you planning on backing it out as well from fx105?

Flags: needinfo?(dsmith)

I was not planning on it because I was hoping bug 1780426 might get fixed in 105. If that is not the case, please let me know.

Flags: needinfo?(dsmith) → needinfo?(nicolas.b.pierron)

(In reply to Dianna Smith [:diannaS] from comment #15)

I was not planning on it because I was hoping bug 1780426 might get fixed in 105. If that is not the case, please let me know.

That is not the case. I am going to abandon this change …
… as it does not want to stick without causing any regressions.

Flags: needinfo?(nicolas.b.pierron)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 104 Branch → ---

After multiple attempts at trying to fix this issue … I am going to abandon it for now, as it only provides improvements when landed with another change which toggle concurrent delazification by default, but that is currently blocked by other issues … including this one.

Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → INCOMPLETE

(In reply to Dianna Smith [:diannaS] from comment #13)

Backout for causing (bug 1780426) in fx104, it remains in fx105

Backout link : https://hg.mozilla.org/releases/mozilla-beta/rev/3e332ff112a8916123cd00293d690131306f363f

== Change summary for alert #34975 (as of Mon, 01 Aug 2022 07:40:11 GMT) ==

Regressions:

Ratio Test Platform Options Absolute values (old vs new)
11% instagram FirstVisualChange android-hw-a51-11-0-aarch64-shippable-qr warm webrender 449.96 -> 499.58
11% instagram SpeedIndex android-hw-a51-11-0-aarch64-shippable-qr warm webrender 451.12 -> 499.67
11% instagram PerceptualSpeedIndex android-hw-a51-11-0-aarch64-shippable-qr warm webrender 459.62 -> 508.58
10% instagram loadtime android-hw-a51-11-0-aarch64-shippable-qr warm webrender 409.60 -> 451.75
5% expedia loadtime macosx1015-64-shippable-qr cold fission webrender 1,197.75 -> 1,260.96
5% expedia LastVisualChange macosx1015-64-shippable-qr cold fission webrender 1,475.00 -> 1,546.67
5% expedia loadtime macosx1015-64-shippable-qr fission warm webrender 929.79 -> 972.42
4% expedia loadtime linux1804-64-shippable-qr cold fission webrender 1,435.00 -> 1,496.46
4% expedia LastVisualChange macosx1015-64-shippable-qr fission warm webrender 1,156.67 -> 1,203.33
4% twitter LastVisualChange windows10-64-shippable-qr bytecode-cached fission warm webrender 1,349.00 -> 1,400.00
4% expedia loadtime linux1804-64-shippable-qr fission warm webrender 1,125.73 -> 1,165.58
3% expedia LastVisualChange linux1804-64-shippable-qr fission warm webrender 1,361.67 -> 1,403.33

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
21% wikia fcp linux1804-64-shippable-qr cold fission webrender 298.83 -> 236.33
21% wikia FirstVisualChange linux1804-64-shippable-qr cold fission webrender 315.00 -> 250.00
18% google-mail loadtime linux1804-64-shippable-qr fission warm webrender 648.25 -> 529.08
16% google-mail loadtime windows10-64-shippable-qr fission warm webrender 592.25 -> 496.04
16% cnn fcp linux1804-64-shippable-qr fission warm webrender 546.50 -> 459.58
... ... ... ... ...
2% cnn LastVisualChange linux1804-64-shippable-qr cold fission webrender 1,928.33 -> 1,886.67

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=34975

(In reply to Dianna Smith [:diannaS] from comment #13)

Backout for causing (bug 1780426) in fx104, it remains in fx105

Backout link : https://hg.mozilla.org/releases/mozilla-beta/rev/3e332ff112a8916123cd00293d690131306f363f

== Change summary for alert #34966 (as of Fri, 29 Jul 2022 21:10:19 GMT) ==

Regressions:

Ratio Test Platform Options Absolute values (old vs new)
304% perf_reftest_singletons slow-selector-2.html macosx1015-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
300% perf_reftest_singletons slow-selector-1.html macosx1015-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
296% perf_reftest_singletons only-children-1.html windows10-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
284% perf_reftest_singletons slow-selector-2.html linux1804-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
265% perf_reftest_singletons only-children-1.html macosx1015-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
257% perf_reftest_singletons only-children-1.html linux1804-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
256% perf_reftest_singletons slow-selector-1.html linux1804-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.08
226% perf_reftest_singletons slow-selector-1.html windows10-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.07
220% perf_reftest_singletons display-none-1.html macosx1015-64-shippable-qr e10s fission stylo webrender 0.03 -> 0.08
216% perf_reftest_singletons display-none-1.html linux1804-64-shippable-qr e10s fission stylo webrender 0.03 -> 0.08
200% perf_reftest_singletons slow-selector-2.html windows10-64-shippable-qr e10s fission stylo webrender 0.02 -> 0.07
182% perf_reftest_singletons display-none-1.html macosx1015-64-shippable-qr e10s fission stylo webrender 0.03 -> 0.08
167% perf_reftest_singletons display-none-1.html windows10-64-shippable-qr e10s fission stylo webrender 0.03 -> 0.07

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=34966

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: