firefox-devtools / firefox-devtools/profiler
Group events by event target (TaskQueue)
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 30
Description
A [TaskQueue](https://searchfox.org/mozilla-central/rev/4ca2f73ae9346709d39de2c8fe33874e4203b9e6/xpcom/threads/TaskQueue.h) is a thread abstraction, but many TaskQueues can sit on top of a thread.
The profiler currently groups events by thread.
In media (playback and webrtc) we extensively use TaskQueues sitting on top of thread pools to cut down the number of threads doing the processing, since they'd be idle to a large extent anyway.
Really we should be talking about event targets instead of TaskQueues. A thread pool is an event target. A TaskQueue is an event target. An nsThread is an event target (though if owned by a thread pool it probably shouldn't be considered one).
Event targets like threads have names, and where TaskQueues are used the TaskQueue name is much more useful than the thread it happens to run on (which if on top of a thread pool could be several).
I would like to see a way of grouping events by event target rather than thread. Event targets can be nested (TaskQueue on top of a thread pool or even another TaskQueue, for instance) so the UI gets a bit different. I can imagine a toggle which switches between thread-grouping and event-target-grouping, but you might have better ideas.
See [this profile](https://profiler.firefox.com/public/70w2wfespcvkgpr94wfnw0n75j36mnjvt652tz8) for an example where (in content process 31208) there are 4 WebrtcWorker threads (one thread pool) running events from possibly many more TaskQueues. Separating these events by TaskQueue would tell me much more about load on a particular TaskQueue than I can see currently, since a TaskQueue run all its events sequentially, though possibly on different threads.
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-486)
Contributor guide
Assessment
This issue has not been assessed yet.