Support baking in constant property values for the global object
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox143 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
(Keywords: perf-alert, Whiteboard: [js-perf-next])
Attachments
(11 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
For bug 1972572 I want start with just the global object and GetNameIRGenerator support. This will add most of the code to also use this for other objects later though.
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
This will be used by a later patch to get the slot number of the removed property.
| Assignee | ||
Comment 2•1 year ago
|
||
This more clearly distinguishes it from the new ObjectFuse-based mechanism.
| Assignee | ||
Comment 3•1 year ago
|
||
This will be used later to invalidate Ion code depending on this particular
property's value.
| Assignee | ||
Comment 4•1 year ago
|
||
Baking in constant property values for the global object was causing test failures
with eager JIT compilation, because of new GC edges from IC stubs for those constants.
| Assignee | ||
Comment 5•1 year ago
|
||
Bug 1977367 added nursery-values support so it should be possible to handle the
nursery case in the future if needed. What makes this a bit tricky is that we don't
know the Value type in that case in the transpiler so we'd either have to store
the type separately in the snapshot or in the ValueOrNurseryValueIndex, or load the
constant as an opaque boxed Value.
| Assignee | ||
Comment 6•1 year ago
|
||
Watchtower only cares about JS property values, not reserved slots, so it doesn't
need to handle those slot changes.
| Assignee | ||
Comment 7•1 year ago
|
||
Later patches will add JIT optimizations based on this.
For now this is only used to bake in constant property values for the global object,
but this could also be used for prototype objects in the future.
| Assignee | ||
Comment 8•1 year ago
|
||
In GCHashTable.h, this changes map.sizeOfExcludingThis to map.shallowSizeOfExcludingThis
because the former doesn't compile (but is currently unused).
| Assignee | ||
Comment 9•1 year ago
|
||
| Assignee | ||
Comment 10•1 year ago
|
||
| Assignee | ||
Comment 11•1 year ago
|
||
| Assignee | ||
Updated•1 year ago
|
Comment 12•1 year ago
|
||
Comment 13•1 year ago
|
||
| Assignee | ||
Updated•1 year ago
|
Comment 14•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/36f159efb12f
https://hg.mozilla.org/mozilla-central/rev/650cbbf408f5
https://hg.mozilla.org/mozilla-central/rev/7f1f9bc812d6
https://hg.mozilla.org/mozilla-central/rev/2bb894bf879b
https://hg.mozilla.org/mozilla-central/rev/db8bfed72beb
https://hg.mozilla.org/mozilla-central/rev/ad4356e3aef4
https://hg.mozilla.org/mozilla-central/rev/785825832f94
https://hg.mozilla.org/mozilla-central/rev/a7b0a9940b39
https://hg.mozilla.org/mozilla-central/rev/2499e94d2177
https://hg.mozilla.org/mozilla-central/rev/cee92ecf074b
https://hg.mozilla.org/mozilla-central/rev/8f373494031e
Comment 15•1 year ago
•
|
||
Improvements on JS2:
~0.5% overall
12.3% on mandreel
10% on richards
12% on crypto-sha1-sp
4% on delt-blue
Improvements on e-b and other crypto tests too.
Kraken
Atleast 1.5%-2% overall
8% on audio-oscillator
11% on imaginf-gaussian-blur
Octane (which is similar for corresponding tests on JS2/JS3)
3.7% on crypto
9% on e-b
13.3% on Mandreel
5.2% on mandreel-latency
4.4% on Richards
| Assignee | ||
Comment 16•1 year ago
|
||
(In reply to Mayank Bansal from comment #15)
Kraken
[...]
11% on imaging-gaussian-blur
Ah yeah this optimization does well there. In this function now height, width, kernelSize, squidImageData, kernel, Math are all constants.
So for example for this loop:
for (var j = 1 - kernelSize; j < kernelSize; ++j) {
we now bake in kernelSize (= 7) so we can generate machine code that just loops from -6 to 6:
[Integer]
movl $0xfffffffa, %r13d # -6
...
[CompareAndBranch:Lt]
cmpl $0x7, %r13d
jge .Lfrom764
Similar for the * width expressions, we can now multiply by a constant for that:
imull $400, %r14d, %r14d
The only global we can't optimize is kernelSum because of how that one gets initialized but that's expected.
Comment 17•1 year ago
|
||
some improvements on six-speed
~10% on map-string-es5
~5% on arrow-args-es5
5% arrow-args-es6
~5% on destructuring
~5% for spread-generator
| Assignee | ||
Updated•1 year ago
|
Comment 18•1 year ago
|
||
12% improvement on sync-fs only on Linux (and maybe slightly on OSX)
Comment 19•1 year ago
|
||
(In reply to Pulsebot from comment #13)
Pushed by jdemooij@mozilla.com:
https://github.com/mozilla-firefox/firefox/commit/2eba132fb701
https://hg.mozilla.org/integration/autoland/rev/785825832f94
part 7 - Add ObjectFuse and use it for the global object. r=iain
https://github.com/mozilla-firefox/firefox/commit/ca838a5a8c4c
https://hg.mozilla.org/integration/autoland/rev/a7b0a9940b39
part 8 - Add memory reporting for object fuses. r=iain
https://github.com/mozilla-firefox/firefox/commit/a24b05c4992f
https://hg.mozilla.org/integration/autoland/rev/2499e94d2177
part 9 - Add IC optimization for constant global object properties. r=iain
https://github.com/mozilla-firefox/firefox/commit/41375298f4c3
https://hg.mozilla.org/integration/autoland/rev/cee92ecf074b
part 10 - Support GuardObjectFuseProperty in Warp. r=iain
https://github.com/mozilla-firefox/firefox/commit/ed06997b0c38
https://hg.mozilla.org/integration/autoland/rev/8f373494031e
part 11 - Support optimizing SetProp for objects with an ObjectFuse. r=iain
Perfherder has detected a talos performance change from push 8f373494031ed192dd97c5019b5ffa7076b0548a.
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) |
|---|---|---|---|---|
| 2% | kraken | windows11-64-24h2-shippable | e10s fission stylo webrender | 474.08 -> 464.27 |
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 46199
The following documentation link provides more information about this command.
Comment 20•1 year ago
|
||
(In reply to Pulsebot from comment #13)
Pushed by jdemooij@mozilla.com:
https://github.com/mozilla-firefox/firefox/commit/2eba132fb701
https://hg.mozilla.org/integration/autoland/rev/785825832f94
part 7 - Add ObjectFuse and use it for the global object. r=iain
https://github.com/mozilla-firefox/firefox/commit/ca838a5a8c4c
https://hg.mozilla.org/integration/autoland/rev/a7b0a9940b39
part 8 - Add memory reporting for object fuses. r=iain
https://github.com/mozilla-firefox/firefox/commit/a24b05c4992f
https://hg.mozilla.org/integration/autoland/rev/2499e94d2177
part 9 - Add IC optimization for constant global object properties. r=iain
https://github.com/mozilla-firefox/firefox/commit/41375298f4c3
https://hg.mozilla.org/integration/autoland/rev/cee92ecf074b
part 10 - Support GuardObjectFuseProperty in Warp. r=iain
https://github.com/mozilla-firefox/firefox/commit/ed06997b0c38
https://hg.mozilla.org/integration/autoland/rev/8f373494031e
part 11 - Support optimizing SetProp for objects with an ObjectFuse. r=iain
Perfherder has detected a browsertime performance change from push 8f373494031ed192dd97c5019b5ffa7076b0548a.
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) | Performance Profiles |
|---|---|---|---|---|---|
| 9% | speedometer3 React-Stockcharts-SVG/PanTheChart/Sync | macosx1470-64-nightlyasrelease | fission webrender | 8.19 -> 7.46 | Before/After |
| 3% | speedometer3 React-Stockcharts-SVG/total | linux1804-64-shippable-qr | fission webrender | 215.23 -> 207.72 | Before/After |
| 3% | speedometer3 React-Stockcharts-SVG/PanTheChart/Async | linux1804-64-shippable-qr | fission webrender | 20.02 -> 19.41 | Before/After |
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 46246
The following documentation link provides more information about this command.
Updated•1 year ago
|
Description
•