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 aconsole.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
1 Answer
Reset to default 8While 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条)