Search code examples
javascriptgoogle-chromegoogle-chrome-devtoolsprofilingweb-worker

Profiling web worker function calls with Chrome


I'm trying to profile a web worker in Chrome to track down some performance issues, but whereas I get a very complete call tree when profiling the large application, the one I get in the worker thread is almost completely empty:

Profiling with an almost empty call tree

Is there anything I should observe when profiling web workers in Chrome, or any option I should enable to get the complete list of calls here?

Thank you!


Solution

  • Turns out the reason was that the web worker was terminated before I stopped profiling. If I keep the worker alive after it finishes its task instead of killing its thread, the profiler works as expected. :)