开发者

Comparing alike javascript code

开发者 https://www.devze.com 2023-02-26 10:04 出处:网络
As we all know, there are multiple ways of going about doing the same thing. I am looking for a way to compare the efficiency of three different JavaScripts that do the same thing. I\'ve placed all of

As we all know, there are multiple ways of going about doing the same thing. I am looking for a way to compare the efficiency of three different JavaScripts that do the same thing. I've placed all of the code in different text files just to rank the file size, but I 开发者_开发百科don't think the smallest code is necessarily the most efficient. I have chrome developer tools, and firebug will these get the job done or is there a fancier way?


you can use the jsPerf.com site to test performance on different js codes.


Use dynatrace to measure the efficiency of the javascript.

http://www.dynatrace.com


One way would be to create some test data, and set up a loop to benchmark each of your Javascript programs by running the data through some number of times, say 10000 repetitions with each program. Use Javascript to time each program and show you the times for each.

0

精彩评论

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