Friday, January 19, 2007

Time your javascript

In web application Javascript performance is important for web application. This is especially with Web 2.0 where javascript usage is increasing. I just found out a good feature in Firebug to measure the performance of your scripts. For those who didn't know, there is a profiling feature in Firebug. I admit I just found out after reading the article AJAX Debugging with Firebug. Jump right into using Firebug without reading what's new there. How could I have miss that feature?

It is really a great tool to time your script. You will get a sample result as below.

Firebug includes a JavaScript profiler that gives you detailed reports on the performance of every function called during a given period. You can start it directly in the toolbar of the Firebug Console tab. The other way is to start it in your code

console.profileEnd("Loading function");

This is definitely a tool that will help out Web Developer a lot.

No comments: