firefox-devtools / firefox-devtools/profiler

Add a mechanism to name Workers

Open
#540 8 comments 0 reactions 0 assignees View on GitHub
needs gecko patch polish
Dominant language
TypeScript
Stars
1.5k
Forks
491
Avg merge
3d 5h
Merged PRs (30d)
30

Description

> Re-filed this issue from juj
>
> ## Add a mechanism to name Workers
> Working on profiling a large 3D engine, with several dedicated threads for audio, physics, statistics, particles, rendering, networking, file io, decompression, game logic and a generic task pool, it takes a lot of time to be able to identify which one is which. In Emscripten, Workers are always loaded from the same laucher url "pthread-main.js" (or from a blob url "blob://long-unreadable-uuid"), see below
>
> ![](https://user-images.githubusercontent.com/225351/29654184-e304bf0a-88b4-11e7-9a5b-309a168e7260.png)
>
> In that image, see on the left, where each thread is name `"DOM Worker 'pthread-..."`, which is difficult to identify the interesting thread.
>
> It would be very useful if there was a way for JS code to assist the profiler by being able to call something like `workerglobalscope.geckoProfiler.setCallingThreadName('audioThread');`. I would then be able to hook these types of calls into the program I am profiling.

┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-666)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.