Allow using another object's iterator for indices optimizations if possible
Categories
(Core :: JavaScript Engine: JIT, enhancement, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox147 | --- | fixed |
People
(Reporter: alexical, Assigned: alexical)
References
(Blocks 2 open bugs)
Details
(Keywords: perf-alert, Whiteboard: [sp3])
Attachments
(1 file)
Assuming a function that looks something like this:
function shallowEqual(objA, objB) {
const keysA = Object.keys(objA);
const keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
for (let i = 0; i < keysA.length; i++) {
const currentKey = keysA[i];
if (
!hasOwnProperty.call(objB, currentKey) ||
objA[currentKey] != objB[currentKey]
) {
return false;
}
}
return true;
}
We currently have optimizations for the megamorphic load for objA, but not the hasOwn / load for objB. However, if we have an iterator we got from objB and it matches the iterator for objA, we should be able to use it as a base for the same optimizations, as long as the two iterators are the same.
| Assignee | ||
Updated•7 months ago
|
Updated•7 months ago
|
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Comment 1•7 months ago
|
||
Updated•7 months ago
|
Comment 4•7 months ago
|
||
Backed out for causing Btime failures.
Backout link: https://hg-edge.mozilla.org/integration/autoland/rev/d7841f30355895b088a47fcd74b1f8af50cc49fd
Failure log: https://treeherder.mozilla.org/logviewer?job_id=537437622&repo=autoland&task=BcL6NxIaQ4SzDFf0nCeQXg.0&lineNumber=1047
Comment 6•7 months ago
|
||
| bugherder | ||
| Assignee | ||
Updated•7 months ago
|
Updated•7 months ago
|
Comment 7•7 months ago
|
||
(In reply to Pulsebot from comment #5)
Pushed by dothayer@mozilla.com:
https://github.com/mozilla-firefox/firefox/commit/288840fe5c11
https://hg.mozilla.org/integration/autoland/rev/317713e4d42c
Allow using another object's iterator indices r=iain,nbp
Perfherder has detected a browsertime performance change from push 317713e4d42c1f24fba40808ac916e190465aa88.
No action is required from the author; this comment is provided for informational purposes only.
Improvements:
| Ratio | Test | Platform | Options | Absolute values (old vs new) | Performance Profiles |
|---|---|---|---|---|---|
| 4% | speedometer3 TodoMVC-React-Redux/CompletingAllItems/Sync | linux1804-64-nightlyasrelease-qr | fission webrender | 38.09 -> 36.72 | Before/After |
| 3% | speedometer3 TodoMVC-React-Redux/CompletingAllItems/total | linux1804-64-nightlyasrelease-qr | fission webrender | 41.00 -> 39.63 | Before/After |
Need Help or Information?
If you have any questions, please reach out to bacasandrei@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.
Description
•