Finding bottlenecks in javascript?

前端 未结 4 1606
南旧
南旧 2021-01-11 14:19

I\'m attempting to find a bottleneck in my Javascript. Basically I\'m developing a chrome extension written in Javascript which is taking 4-5 seconds to perform a task. Ther

相关标签:
4条回答
  • 2021-01-11 14:39

    I remember Google Chrome has a built-in JavaScript profiler. Or can't you use this for your extension? (I have never built Chrome extensions.)

    0 讨论(0)
  • 2021-01-11 14:41

    Open your page in Chrome.

    Tools -> Developer tools -> Profiles

    Start Profiling (3rd button, grey circle on the status bar at the bottom)

    0 讨论(0)
  • 2021-01-11 14:49

    You can try to use Profiler as it was mentioned before or Timeline. Timeline will help you if the time was spent in native code.

    0 讨论(0)
  • 2021-01-11 14:58

    Perhaps it'd be a good idea to open the HTML files in Firefox instead of letting Chrome extensions handle it. That'd allow you to use Firebug to determine any causes, which would be very helpful.

    0 讨论(0)
提交回复
热议问题