开发者

What is the best way to profile my javascript code ? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or e开发者_如何学Pythonxtended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

I am interested in know how much memory my JavaScript code running inside a browser is consuming and how it is increasing decreasing with time. How do I do it ?


http://getfirebug.com/javascript

Firebug includes a powerful JavaScript debugger that lets you pause execution at any time and see what each variable looked like at that moment. If your code is a little sluggish, use the JavaScript profiler to measure performance and find bottlenecks fast.

Edit : You may refer previously answered questions on stackoverflow.

JavaScript Profiler in IE

Javascript memory profiler for Firefox

Measuring Javascript performance in IE

How to profile and and get Javascript performance

http://www.imnmotion.com/documents/html/technical/dhtml/jsprof.html


If you are using FireFox then Firebug is perfect for this application. I'd highly recommend it for debugging javascript in browser.

StackOverflow: what-is-the-best-way-to-profile-javascript-execution

Looks like this would be a good answer for you too.


It depends on your browser... If you're using Chrome (that's what i'm using...):

  • Open up the page
  • Right click anywhere -> Inspect element (opens up Dev toolbar)
  • Go to Profiles tab
  • Click the little "recording" icon (cirle) at the bottom of the screen (4th button)
  • When it's read it's indicating it's recording
  • Do your thing
  • Click the rec button again
  • enjoy the statistics
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜