Closed Bug 2079392 Opened 1 month ago Closed 1 month ago

Enqueue a subset of settled reaction tasks by value

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
161 Branch
Tracking Status
firefox161 --- fixed

People

(Reporter: mgaudet, Assigned: mgaudet)

References

(Blocks 2 open bugs)

Details

(Keywords: perf-alert)

Attachments

(6 external files)

We can avoid allocating a good number of PromiseReactionRecords if we make MicroTasks hold some values. Let's do it -- we get some good results performance wise by doing this.

This is a setup patch to centralize the allocation of the PromiseReactionRecord, which we
are going to elide under some circumstances shortly.

Assignee: nobody → mgaudet
Status: NEW → ASSIGNED

Refactoring to support multiple representations

(this is a total drive-by, it just irked me when I saw it )

By adding room to MicroTask we can enqueue simple promise reactions without needing to allocate
a PromiseReactionRecords.

Reactions which can't be transparently represented as MicroTask values are instead converted to
PromiseReactionRecords, which go through the normal path.

Local measurements get about 5% win on doxbee-promise, and about 25% on doxbee-async.

Note: Profiler flow markers for reactions held by value are only emitted when the
profiler is enabled at the time the reaction is enqueued; otherwise the task
has no flow id and JSMicroTaskRef::getFlowId returns false. This is justifiable because
flow markers are not the default (nor are they super widely used yet)

Blocks: 2079500
Severity: -- → N/A
Priority: -- → P2

Mechanical rename. These are the JSObject-backed promise jobs; naming them
*Object distinguishes them from jobs held inline in a JS::MicroTask.

Mechanical rename. The job for this kind is a PromiseReactionRecord object,
as opposed to a reaction held inline in the JS::MicroTask.

Attachment #9655258 - Attachment description: Bug 2079392 - Create an abstract promise reaction record interface r?#spidermonkey-reviewers → Bug 2079392 - Separate Promise Reaction Storage from Interface r?#spidermonkey-reviewers
Blocks: 2086205
Pushed by mgaudet@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8c6dae23625f https://hg.mozilla.org/integration/autoland/rev/385cd0aef594 Rename MicroTaskEntry to PromiseJobObject and ThenableJob to ThenableJobObject r=spidermonkey-reviewers,yulia https://github.com/mozilla-firefox/firefox/commit/4c113413b243 https://hg.mozilla.org/integration/autoland/rev/a940ba589606 Rename the PromiseReaction microtask kind to PromiseReactionObject r=spidermonkey-reviewers,yulia https://github.com/mozilla-firefox/firefox/commit/94e72707c96a https://hg.mozilla.org/integration/autoland/rev/061519822d92 Move ReactionRecord allocation into dedicated helper r=spidermonkey-reviewers,jonco https://github.com/mozilla-firefox/firefox/commit/f57e5476ea7b https://hg.mozilla.org/integration/autoland/rev/9baf61f00ff0 Separate Promise Reaction Storage from Interface r=spidermonkey-reviewers,jonco https://github.com/mozilla-firefox/firefox/commit/42f9d6f6deb6 https://hg.mozilla.org/integration/autoland/rev/01317b514279 Use RootedTuple for host defined data in NewReactionRecord r=spidermonkey-reviewers,jonco https://github.com/mozilla-firefox/firefox/commit/cb3f9dbf4d12 https://hg.mozilla.org/integration/autoland/rev/0ac017db3b92 Support settled promise reaction without object allocation r=spidermonkey-reviewers,jonco

Perfherder has detected a mozperftest performance change from push 0ac017db3b927bdcac43bab794ad491588dcb670.

No action is required from the author; this comment is provided for informational purposes only.

Improvement Test Platform Options Absolute values [old vs new]
3% browser_translations_perf_tiny.js post-gc-inference-process-memory-usage linux2404-64-shippable 229.51 MiB -> 223.77 MiB
3% browser_translations_perf_tiny.js stabilized-inference-process-memory-usage linux2404-64-shippable 230.15 MiB -> 224.39 MiB
2% browser_translations_perf_tiny.js peak-inference-process-memory-usage linux2404-64-shippable 244.33 MiB -> 238.56 MiB

Need Help or Information?

If you have any questions, please reach out to acseh@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

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

Keywords: perf-alert

Perfherder has detected a browsertime performance change from push 0ac017db3b927bdcac43bab794ad491588dcb670.

No action is required from the author; this comment is provided for informational purposes only.

Improvements Test Platform Options Absolute values [old vs new]
26% jetstream3 doxbee-async-Geometric (doc) linux2404-64-shippable fission webrender 79.51 score -> 99.97 score
25% jetstream3 doxbee-async-Geometric (doc) windows11-64-24h2-shippable fission webrender 150.26 score -> 187.74 score
21% jetstream3 doxbee-async-Geometric (doc) macosx1500-aarch64-shippable fission webrender 194.64 score -> 236.26 score
19% jetstream3 doxbee-async-Geometric (doc) linux2404-64-shippable fission webrender 80.73 score -> 96.30 score
19% jetstream3 doxbee-async-Average (doc) linux2404-64-shippable fission webrender 53.90 ms -> 43.85 ms
... ... ... ... ...
17% jetstream3 doxbee-async-Average (doc) android-hw-a55-14-0-aarch64-shippable fission webrender 80.11 ms -> 66.79 ms

Need Help or Information?

If you have any questions, please reach out to aesanu@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

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

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

Attachment

General

Created:
Updated:
Size: