javascript - Can I measure the performance of a webworker using Chrome dev tools? - Stack Overflow

I have a project where a lot of the total putation time is spent inside workers - the main thread just

I have a project where a lot of the total putation time is spent inside workers - the main thread just waits until a bunch of workers are finished. But I want to see which part of my code is slowing everything down the most.

So logically I use dev tools to measure the performance:

Sorry for the bad quality, but notice that I measured the performance for 11000ms seconds but only a self time of about 6500ms is shown. So there is about 4500ms which I can't see.

Usually I use this tool to figure out which part of my code I should improve to refine the process, as it shows the ms taken line by line

Is there any way I can view the performance of web workers?

I have a project where a lot of the total putation time is spent inside workers - the main thread just waits until a bunch of workers are finished. But I want to see which part of my code is slowing everything down the most.

So logically I use dev tools to measure the performance:

Sorry for the bad quality, but notice that I measured the performance for 11000ms seconds but only a self time of about 6500ms is shown. So there is about 4500ms which I can't see.

Usually I use this tool to figure out which part of my code I should improve to refine the process, as it shows the ms taken line by line

Is there any way I can view the performance of web workers?

Share Improve this question asked Jul 19, 2017 at 16:56 Thomas WagenaarThomas Wagenaar 6,7796 gold badges35 silver badges84 bronze badges 7
  • try adding performance.now() to a console.log()? – Mike Commented Jul 19, 2017 at 17:03
  • You can view in scripts the workers you have and from there open dev console for that worker – juvian Commented Jul 19, 2017 at 17:07
  • @juvian how does one do that? – Thomas Wagenaar Commented Jul 19, 2017 at 17:21
  • Try umaar./dev-tips/89-debug-per-thread – juvian Commented Jul 19, 2017 at 18:00
  • @juvian I tried what is told in that link, but it doesn't allow me to see the performance – Thomas Wagenaar Commented Jul 19, 2017 at 18:07
 |  Show 2 more ments

1 Answer 1

Reset to default 8

While the best way of meassuring the worker job is to profile the job without worker, you might miss things such as time spent on transfers and messages with main threads. After some time playing around with chrome dev console, ended up finding that in profiler you can view in timeline below main thread the worker thread execution, and in call tree you can change from main to DedicatedWorker thread :

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744315431a4568158.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信