Consider to add a separate queue for window.postMessage and process it with lower priority during page load

RESOLVED FIXED in Firefox 69

Status

()

enhancement
P3
normal
RESOLVED FIXED
5 months ago
3 months ago

People

(Reporter: smaug, Assigned: sefeng)

Tracking

(Blocks 1 bug)

unspecified
mozilla69
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox69 fixed)

Details

Attachments

(3 attachments)

Facebook seems to use postMessage rather early during pageload, and it has some heavy event listener for the message event.

https://perfht.ml/2NQVDG8

Perhaps the postMessage queue which bug 1512388 needs can be used here.

Priority: -- → P3
Component: DOM → DOM: Core & HTML

Looks like this could affect positively to google-mail and yahoo-news. So worth to look at some more.

Assignee: nobody → sefeng

WPT bug that needs to be fixed first: https://github.com/web-platform-tests/wpt/issues/16540

Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7fa8e33635fc
Use a low priority ThrottledEventQueue for postMessages during page load r=smaug

PostMessage Event uses "PostMessage task source" which is different
than "DOM manipulation task queue"; Update the code to use detail
object instead.

Depends on D27386

Regressions: 1550606
Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ef5bf4372b76
Use a low priority ThrottledEventQueue for postMessages during page load r=smaug
https://hg.mozilla.org/integration/autoland/rev/55c360c47f31
Update postMessage usage in WPT for promise rejection r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16925 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Upstream PR merged

== Change summary for alert #21015 (as of Tue, 21 May 2019 07:34:34 GMT) ==

Improvements:

26% raptor-tp6-yahoo-news-firefox loadtime windows10-64-shippable-qr opt 481.21 -> 356.17
26% raptor-tp6-yahoo-news-firefox loadtime windows10-64-shippable opt 481.83 -> 357.71
24% raptor-tp6-yahoo-news-firefox loadtime linux64-shippable-qr opt 510.21 -> 386.79
23% raptor-tp6-yahoo-news-firefox loadtime windows7-32-shippable opt 468.71 -> 362.00
21% raptor-tp6-yahoo-news-firefox loadtime linux64-shippable opt 465.96 -> 365.83
7% raptor-tp6-yahoo-news-firefox windows10-64-shippable opt 290.02 -> 268.48
7% raptor-tp6-yahoo-news-firefox windows10-64-shippable-qr opt 289.48 -> 268.46
5% raptor-tp6-yahoo-news-firefox windows7-32-shippable opt 286.52 -> 270.82
5% raptor-tp6-yahoo-news-firefox linux64-shippable opt 294.51 -> 279.56
5% raptor-tp6-yahoo-news-firefox linux64-shippable-qr opt 314.07 -> 298.39

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=21015

Flags: needinfo?(sefeng)

Updated a screenshot to show the performance changes between Firefox and Chrome for Yahoo News.

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