Closed Bug 1957504 Opened 6 months ago Closed 5 months ago

wasm: enable lazy tiering for all content

Categories

(Core :: JavaScript: WebAssembly, task, P1)

task

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: rhunt, Assigned: jseward)

References

Details

(Keywords: perf-alert)

Attachments

(1 file)

We believe that enabling lazy tiering for all content (not just GC modules) will improve startup time and also peak performance through support for inlining.

For shipping this, we need to:

  1. Flip the 'lazy_tiering' pref to true [1]
  2. Disable lazy tiering when the 'test serialization' pref is turned on [2]. This will keep us testing serialization by falling back to eager compilation.

We probably also want to:

  1. Decide what to do if we don't have helper threads available. Right now we will disable tiering and fall back to a 'once' compilation [3]. We possibly could fall back to synchronous compilation in that case. That is how JS works, if I understand correctly.
  2. (pre-existing) Ensure that CanFlushExecutionContextForAllThreads is thread safe. It looks like there is a race condition in the function around 'computed' and 'hasMembarrier'.

As a follow up once lazy tiering for all content has been shipped in a release or two, we should replace the two lazy tiering prefs with an 'eager' tiering pref that is off by default.

[1] https://searchfox.org/mozilla-central/rev/7857ea04d142f2abc0d777085f9e54526c7cedf9/modules/libpref/init/StaticPrefList.yaml#8879-8883
[2] https://searchfox.org/mozilla-central/rev/7857ea04d142f2abc0d777085f9e54526c7cedf9/js/public/WasmFeatures.h#157
[3] https://searchfox.org/mozilla-central/rev/7857ea04d142f2abc0d777085f9e54526c7cedf9/js/src/wasm/WasmCompile.cpp#837
[4] https://searchfox.org/mozilla-central/rev/7857ea04d142f2abc0d777085f9e54526c7cedf9/js/src/jit/FlushICache.cpp#59

Summary: Enable lazy tiering for all content → wasm: enable lazy tiering for all content

Currently wasm lazy tiering is enabled by default only for content that uses
the wasm-GC feature set. This patch enables lazy tiering for all wasm content.
Lazy tiering is disallowed if the "test serialization" pref is enabled, or if
no helper threads are available.

As a ridealong fix, a potential race in CanFlushExecutionContextForAllThreads
is fixed -- applies to 32- and 64-bit ARM on Linux and Android only.

Pushed by jseward@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/aa847437363d wasm: enable lazy tiering for all content. r=rhunt.

Backed out for causing Mochitest LeakSanitizer failures

Flags: needinfo?(jseward)

There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:jseward, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(rhunt)
Flags: needinfo?(jseward)

We're working on it.

Flags: needinfo?(rhunt)
Flags: needinfo?(jseward)
Pushed by jseward@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1ae7fced5a24 wasm: enable lazy tiering for all content. r=rhunt.
Pushed by jseward@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9618824194c5 wasm: enable lazy tiering for all content. r=rhunt.
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch

17% improvement on Godot-tiering.
(this is a best guess as these tests run on m-c so i dont know how to do backfills)

Regressions: 1963772

~1% overall improvement on Jetstream2
driven by:

Flags: needinfo?(jseward)
Regressions: 1964966

(In reply to Pulsebot from comment #8)

Pushed by jseward@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9618824194c5
wasm: enable lazy tiering for all content. r=rhunt.

Perfherder has detected a devtools performance change from push 9618824194c55ecf89f162b1044e637171067a7b.

If you have any questions, please reach out to a performance sheriff. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
17% damp source-map.simple.DAMP linux1804-64-shippable-qr e10s fission stylo webrender 208.42 -> 173.52
12% damp source-map-loader.init.DAMP windows11-64-24h2-shippable e10s fission stylo webrender 51.58 -> 45.37
6% damp source-map.simple.DAMP windows11-64-24h2-shippable e10s fission stylo webrender 92.67 -> 87.39

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a performance sheriff to do that for you.

You can run all of these tests on try with ./mach try perf --alert 44986

The following documentation link provides more information about this command.

Keywords: perf-alert

(In reply to Sebastian Hengst [:aryx] (needinfo me if it's about an intermittent or backout) from comment #9)

https://hg.mozilla.org/mozilla-central/rev/9618824194c5

Perfherder has detected a mozperftest performance change from push 9618824194c55ecf89f162b1044e637171067a7b.

If you have any questions, please reach out to a performance sheriff. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
44% browser_translations_perf_es_en.js peak-memory-usage windows11-64-24h2-shippable 564.99 -> 318.53
42% browser_translations_perf_es_en.js peak-memory-usage linux1804-64-shippable 479.39 -> 278.16
42% browser_translations_perf_es_en.js peak-memory-usage macosx1015-64-shippable-qr 484.70 -> 283.45
9% browser_translations_perf_es_en.js engine-init-time linux1804-64-shippable 299.11 -> 271.91
7% browser_translations_perf_es_en.js stabilized-memory-usage linux1804-64-shippable 293.92 -> 274.15
... ... ... ... ...
6% browser_translations_perf_es_en.js stabilized-memory-usage windows11-64-24h2-shippable 331.89 -> 311.60

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a performance sheriff to do that for you.

You can run all of these tests on try with ./mach try perf --alert 44982

The following documentation link provides more information about this command.

QA Whiteboard: [qa-triage-done-c141/b140]
Regressions: 1963732
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: