Closed Bug 1858040 Opened 1 year ago Closed 11 months ago

Investigate lazy function name for getter and setter functions

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

(Keywords: perf-alert)

Attachments

(3 files)

the combination of bug 1848278 and bug 1850197 is troublesome in term of binary size, because we'll have more static data for accessor function name, length, and hash.

But given the main target here is WebIDL properties, the accessor names are not likely be actually retrieved in regular website.

If we can make the accessor name calculation lazy, specifically, more lazy than CreateInterfaceObject, so that it's calculated only when the function name is actually accessed, we don't have to worry about the static data size or startup cost of those accessor names.

Depends on: 1859207

Using lazy name makes some operation around function name fallible, or returns unprefixed name.
all related parts should be updated to either get prefixed name with fallible operation, or use possibly-unprefixed name if it's only for debugging/information purpose

For accessors with FunctionFlags::LAZY_ACCESSOR_NAME, JSFunction::AtomSlot
contains unprefixed name.

This patch also split existing methods and APIs for function name into 3:

  1. infallible, and can return unprefixed name
  2. fallible, and returns correct name
  3. (internal only) infallibe, and returns correct name (only for functions known to not have FunctionFlags::LAZY_ACCESSOR_NAME)

If the result doesn't have to be exactly correct name, for example if it's for
debug logging or profiler marker, the 1st infallible functions are used.

Depends on D191456

Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/f539af00cf91 Part 1: Use FunctionKind::{Getter,Setter} for native functions created from JSPropertySpec. r=jandem https://hg.mozilla.org/integration/autoland/rev/750908d92ab1 Part 2: Add FunctionFlags::LAZY_ACCESSOR_NAME to lazily create accessor function name from unprefixed name. r=jandem https://hg.mozilla.org/integration/autoland/rev/2744df17e06b Part 3: Use lazy name for accessors created with JSPropertySpec. r=jandem
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch

(In reply to Pulsebot from comment #5)

Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/f539af00cf91
Part 1: Use FunctionKind::{Getter,Setter} for native functions created from
JSPropertySpec. r=jandem
https://hg.mozilla.org/integration/autoland/rev/750908d92ab1
Part 2: Add FunctionFlags::LAZY_ACCESSOR_NAME to lazily create accessor
function name from unprefixed name. r=jandem
https://hg.mozilla.org/integration/autoland/rev/2744df17e06b
Part 3: Use lazy name for accessors created with JSPropertySpec. r=jandem

== Change summary for alert #40074 (as of Mon, 30 Oct 2023 22:56:51 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
2% Base Content JS windows11-64-2009-shippable-qr fission 1,575,078.00 -> 1,548,915.33
2% Base Content JS linux1804-64-shippable-qr fission 1,572,616.00 -> 1,546,699.33
2% Base Content JS macosx1015-64-shippable-qr fission 1,573,432.00 -> 1,547,512.00

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

Keywords: perf-alert

(In reply to Pulsebot from comment #5)

Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/f539af00cf91
Part 1: Use FunctionKind::{Getter,Setter} for native functions created from
JSPropertySpec. r=jandem
https://hg.mozilla.org/integration/autoland/rev/750908d92ab1
Part 2: Add FunctionFlags::LAZY_ACCESSOR_NAME to lazily create accessor
function name from unprefixed name. r=jandem
https://hg.mozilla.org/integration/autoland/rev/2744df17e06b
Part 3: Use lazy name for accessors created with JSPropertySpec. r=jandem

== Change summary for alert #40075 (as of Tue, 31 Oct 2023 00:23:19 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
55% perf_reftest display-none-1.html linux1804-64-shippable-qr e10s fission stylo webrender-sw 0.56 -> 0.25
41% perf_reftest_singletons display-none-1.html macosx1015-64-shippable-qr e10s fission stylo webrender 1.01 -> 0.60
40% perf_reftest_singletons display-none-1.html windows10-64-shippable-qr e10s fission stylo webrender 0.93 -> 0.56
40% perf_reftest_singletons only-children-1.html macosx1015-64-shippable-qr e10s fission stylo webrender 1.08 -> 0.65
39% perf_reftest_singletons slow-selector-2.html macosx1015-64-shippable-qr e10s fission stylo webrender 1.07 -> 0.65
... ... ... ... ...
7% perf_reftest_singletons style-sharing-style-attr.html linux1804-64-shippable-qr e10s fission stylo webrender 6.01 -> 5.61

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

== Change summary for alert #40077 (as of Tue, 31 Oct 2023 00:26:59 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
5% damp console.log-in-loop-content-process-window windows10-64-shippable-qr e10s fission stylo webrender 203.62 -> 192.78
5% damp console.log-in-loop-content-process-window windows10-64-shippable-qr e10s fission stylo webrender-sw 203.53 -> 193.68

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

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

Attachment

General

Created:
Updated:
Size: