Open Bug 1644284 Opened 8 months ago Updated 7 months ago

Investigate postponing setTimeout/Interval runs when there is important user input pending


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





(Reporter: smaug, Assigned: sefeng, NeedInfo)



In some cases timeout callbacks get run while there might be more important user input
(non-move events basically) pending.
Same issue applies to xhr.onload and fetch() and such. But perhaps worth to investigate if setTimeout/Interval case could be improved, and whether that could help with responsiveness.

Note, input events do already have their own queue. So it is possible that it should be tweaked instead. Or that setTimeout/Interval should get their own priority in the main thread (even though they already use a ThrottledEventQueue).

Assignee: nobody → sefeng
Depends on: 1648284

We started this task by implementing a telemetry to report the number of pending input events in IPC channel when the timeout handler is about to run.

Looking at the first 2 days data, 99% were 0, so perhaps we don't need to do any tweaks since most of the time there are just 0 pending inputs. But yeah, we should check the graph again once we have more data.

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