How to profile web workers in Chrome?

Does anyone know an easy way to profile web workers in Chrome? I found this question from last year, but unfortunately the only answer provided did not work.

Is there a way to do this or am I just not up to date? This seems like a pretty big oversight that impedes website development if you can't even do the profiling.

+4
source share
2 answers

In the "Web Workers" profile, go to "Developer Tools → Sources → Workers" and check the "Pause at Startup" box. Now, when you refresh the page, a popup will appear with an inspector for each worker.

In the inspector window, go to the "Profiles" tab and start profiling. Now you need to go back to the Sources tab and click on the Resume script icon in the right icon bar.

This approach does not work for some older versions of Chrome (Chrome 33 and below, compare Chromium Issue 180377 ) - there the inspector windows remain empty, except for the URL in the address bar. In Chrome 35, it works for me.

+3
source

It appears that in newer versions of Chrome, the Workers tab (in the debugger, nested in the Sources tab on the right) has been merged with the Themes tab. I am using the Chrome version of version 39.0.2171.95 m (as of December 23, 2014).

+1
source

Source: https://habr.com/ru/post/944083/


All Articles