开发者

Finding bottlenecks in javascript?

开发者 https://www.devze.com 2023-02-06 16:40 出处:网络
I\'m atte开发者_C百科mpting 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. There\'s a lot of c

I'm atte开发者_C百科mpting 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. There's a lot of code involved in the task and using print statements / chrome built in dev tools just isnt working. The dev tools don't seem to even see my Javascript running. I'm wondering if anyone has any advice / tools they think could be of benefit?


Open your page in Chrome.

Tools -> Developer tools -> Profiles

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


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.


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.)


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

精彩评论

暂无评论...
验证码 换一张
取 消