5

Possible Duplicate:
How to profile and and get Javascript performance

I have a page with several client scripts. Some scripts are slowing the page and there could also be a memory leak. Is there a tool that tells you clearly how much time is being consumed by which scripts please?

Community
  • 1
  • 1
Joseph Caruana
  • 2,241
  • 3
  • 31
  • 48
  • 3
    please use the search function before posting a new question - there are already several questions on that topic, e.g. http://stackoverflow.com/questions/750255/javascript-performance-optimisation, http://stackoverflow.com/questions/2140716/how-to-profile-and-and-get-javascript-performance – codeling Dec 31 '11 at 12:09
  • [Firebug / Profiler](http://getfirebug.com/javascript) ? – Manse Dec 31 '11 at 12:10

2 Answers2

2

See here: Best Practices for Speeding Up Your Web Site

From the Yahoo Developer Network:

The Exceptional Performance team has identified a number of best practices for making web pages fast. The list includes 35 best practices divided into 7 categories.

NakedBrunch
  • 48,713
  • 13
  • 73
  • 98
1

You can use firebug to profile your javascript and see where the bottlenecks are.

From the website:

To use the profiler, just go to the Console tab and click the "Profile" button. Then use your app for a bit or reload the page and then click the "Profile" button again. You'll then see a detailed report that shows what functions were called and how much time each one took.

Vincent Ramdhanie
  • 102,349
  • 23
  • 137
  • 192
  • 1
    nearly literal copy from an answer to a duplicate question: http://stackoverflow.com/a/2140748/671366. With 27.2k points you should know how to use the search function and flag such questions as duplicates... – codeling Dec 31 '11 at 12:14
  • @nyarlathotep: To be fair, both answers are equal because they mostly consist of the same quote, which does not imply it is a copy. – Felix Kling Dec 31 '11 at 12:19
  • @FelixKling: true, "copy" is a harsh word for that since only the quote is the same but not the actual answer. Still I find the information content of that answer minimal (given that there are links to the duplicate questions, which provide many more answers than this one), so flagging as duplicate would have been the appropriate choice in my eyes instead of answering. – codeling Dec 31 '11 at 12:22