Closed Bug 1488863 Opened 6 years ago Closed 6 years ago

Consider to fire timers less often during page load

Categories

(Core :: DOM: Core & HTML, enhancement, P2)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1270059
Performance Impact high

People

(Reporter: smaug, Unassigned)

References

(Blocks 2 open bugs)

Details

(Keywords: perf:pageload)

Attachments

(1 file)

I was profiling https://www.huffingtonpost.com/ page load. It seems to use setTimeout quite heavily during page load, and the timers fire before load event - if one loads the page in foreground. When loaded in background, we throttle timers and they fire way later. This causes for example some slow js function to be execute way after load event.
Whiteboard: [qf]
Looks like this happens with https://www.nationalgeographic.com/ too
Priority: -- → P2
Attached patch slower_load_timers.diff (deleted) — Splinter Review
Just something for testing. Breaks probably all the tests :) remote: Follow the progress of your build on Treeherder: remote: https://treeherder.mozilla.org/#/jobs?repo=try&revision=536a8a06eb5f7a1cce4c7a3e12a9cfe741f882a4 remote: remote: It looks like this try push has talos jobs. Compare performance against a baseline revision: remote: https://treeherder.mozilla.org/perf.html#/comparechooser?newProject=try&newRevision=536a8a06eb5f7a1cce4c7a3e12a9cfe741f882a4 remote: recorded changegroup in replication log in 0.015s
Whiteboard: [qf] → [qf:p1:f64]
This is likely related to Bug 1373723 -- in particular if Chrome is clamping setTimeout(0) to 1ms then they are, I believe, effectively deferring the event handling to the next frame. Perhaps the clamping solution could be considered as well as the above slow load timers. (I did a test of it here: https://phabricator.services.mozilla.com/D10946)
Assignee: nobody → bugs
Whiteboard: [qf:p1:f64] → [qf:p1:pageload]
Blocks: 1519204

I think I'm rather busy with getting paint to happen sooner, so if anyone has time for this, feel free to take.

Assignee: bugs → nobody
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
Performance Impact: --- → P1
Keywords: perf:pageload
Whiteboard: [qf:p1:pageload]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: