Add a DeferredTimers queue that executes before the normal Idle queue
Categories
(Core :: XPCOM, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox66 | --- | fixed |
People
(Reporter: jesup, Assigned: jesup)
References
Details
(Keywords: perf:pageload)
Attachments
(3 files, 1 obsolete file)
(deleted),
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
We want to prioritize deferred setTimeout/setInterval timers (bug 1270059) ahead of "normal" idle tasks, and to do that the simplest method is to add another queue to PrioritizedEventQueue.cpp/etc
Overall it's straightforward, though a few bits of care are needed as there are now 2 "idle" queues to be concerned with.
Assignee | ||
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
Or if we want to think DeferredTimers as a variant of idle queue, perhaps separate enum which can be passed to NS_Idle* methods. The enum would only have Idle and DeferredTimers, defaulting to Idle.
Assignee | ||
Comment 4•6 years ago
|
||
The naming is now a bit wonky. I was going to go through and rename, but OTOH the default if you don't add the param is to dispatch to the Idle queue. I figure if someone (froyd) has a strong preference on how the NS_FooToBar stuff should look, I'll just make it do that.
I could just add NS_DeferredTimerDispatchToCurrentThread() instead of all the other changes, for example, or an independent "which idle queue" bool/enum - but I'm not sure that's a great solution.
I was trying to think ahead, realizing that chrome found reasons to have something crazy like 70+ queues.
Bas said: Maybe we'll want less than 70, but I feel we'll almost certainly discover we'll find more.
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
Assignee | ||
Comment 7•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 8•6 years ago
|
||
Updated•6 years ago
|
Comment 9•6 years ago
|
||
(In reply to Randell Jesup [:jesup] from comment #8)
Created attachment 9039024 [details] [diff] [review]
Rename NS_IdleDispatch* functions since they take queue identifiersThis renames the API methods to avoid 'NS_Idle*' for things that can touch
any queue.
FWIW I just added a couple more of these calls in bug 1522370 and bug 1522630.
Comment 10•6 years ago
|
||
Comment 11•6 years ago
|
||
I meant to r- part 2, whoops.
(In reply to Nathan Froyd [:froydnj] from comment #10)
So that the caller never directly passes EventPriority, but leaves that to
the particular named function. I realize this makes the API surface huge
(and I think we do want to do something about that...but not yet), but my
sense is that a larger API surface here is preferable to enabling people to
pass in unconstrained EventPriority values, at least for the moment.
Oh, I see that part 3 actually does a renaming, which makes this a little more palatable, and also complains about using queues we don't expect. Hmm...
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
Comment 14•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0f5c896960f5
https://hg.mozilla.org/mozilla-central/rev/65cf08e33fe2
Updated•3 years ago
|
Description
•