Closed Bug 1836700 Opened 1 year ago Closed 8 months ago

Eliminate busy count tracking from WorkerRunnables

Categories

(Core :: DOM: Workers, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: asuth, Assigned: edenchuang)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Eliminate busy count tracking in favor of just letting WorkerRefs, the existence of IPC actors, and (newly proposed) the presence of events in our main-thread ThrottledEventQueues/worker debugee queues keep a worker alive. This enables a simplification of the WorkerRunnable implementation. This is a spin-off follow-up from bug 1800659 which going to originally address this (but which quite reasonably was de-scoped).

One particular benefit is there is no need for runnables sent to the main thread to have a reference to the WorkerPrivate (to update the busy count), however it's likely that we would want to approximate the original design behavior by having the GC traversal logic in WorkerPrivate::Traverse that Worker::Traverse calls into:

  • Check if there are any runnables in our mMainThreadDebuggeeEventTarget main thread-targeted ThrottledEventQueue. This is a new proposal with the filing of this bug, but an easy thing for us to check that could potentially allow us to continue to GC in more cases.
  • We also would like to be aware of runnables resulting from Worker.postMessage; most practically having any runnables in the queue would be sufficient but would err on the side of GCing less.
  • Check if there are StrongWorkerRefs. (IPCWorkerRefs would continue to not prevent GC, as would also be the case for WeakWorkerRefs.)
Blocks: 1769913
Assignee: nobody → echuang

I have some local patches for this, so I take this bug.

Blocks: 1805613
Attachment #9342211 - Attachment description: Bug 1836700 - Remove BusyCount of WorkerRunnable. r=#dom-worker-reviewers → Bug 1836700 - Remove BusyCount of WorkerPrivate. r=#dom-worker-reviewers
See Also: → 1855327
Pushed by echuang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ff2400205932
Remove BusyCount of WorkerPrivate. r=asuth,ipc-reviewers,mccr8
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
Regressions: 1864661
Regressions: 1864459
Regressions: 1864809
Regressions: 1865774
Regressions: 1865917

== Change summary for alert #40233 (as of Tue, 14 Nov 2023 14:05:28 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
21% damp source-map-loader.getOriginalLocation.DAMP linux1804-64-shippable-qr e10s fission stylo webrender-sw 133.77 -> 105.90
21% damp source-map-loader.getOriginalLocation.DAMP linux1804-64-shippable-qr e10s fission stylo webrender 136.95 -> 108.79
16% damp source-map-loader.getOriginalLocation.DAMP windows10-64-shippable-qr e10s fission stylo webrender 183.72 -> 154.83
15% damp source-map-loader.getOriginalLocation.DAMP windows10-64-shippable-qr e10s fission stylo webrender-sw 187.28 -> 159.12
13% damp source-map-loader.getOriginalLocation.DAMP macosx1015-64-shippable-qr e10s fission stylo webrender 158.75 -> 138.26
... ... ... ... ...
2% damp custom.jsdebugger.project-search.DAMP windows10-64-shippable-qr e10s fission stylo webrender 2,153.88 -> 2,109.49

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=40233

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

Attachment

General

Created:
Updated:
Size: