Calculating JavaScript library load time

I am trying to compare the performance of several Javascript libraries. While measuring transaction time can help determine the performance of a library, it does not take into account the time required to load and run individual libraries. I'm looking for suggestions for a better method for determining load times other than using tools like firebug etc. I would like to be able to set up a controlled environment where the page can be loaded n times while still capturing the start and end time. Should the content of the Javascript library be included in the page and not as an include file, or is there a better way?

0


a source to share


2 answers


After reading this article by John Resig on Quality Benchmark for Quality before you start anything, you can help.



After that I suggest you try to request javascript from your break, get and define the time it eval(responseJS);

takes. This way you only determine the time it takes for the library to load, not the time it takes to load from the server.

+1


a source


Libraries should always be an external file, included via the script tag, either on their own or with a site script also included. Miniature and zipped files will have a smaller attachment. Delivered via CDN is also optimal as the CDN will be cached. Many of the popular frameworks are available through the Google CDN.

You also have to consider not only the library, but also the application using the library. The JS quality in the libraries is (generally) the highest, but what about the quality of the code used in those libraries, or even plugin code that cannot be developed by the authors of the library. You should also look at which browser you are using. As much as we hate, most of these cross-browser libraries are optimized for better performance from Internet Explorer as it retains 85% of the market share.



The performance of any library is really a trade-off. Deciding what is acceptable so that your application can do what you want to do.

0


a source







All Articles