Analyzing the efficiency of Ajax Liang Zhou [email protected].

15
Analyzing the efficiency of Ajax Liang Zhou [email protected]

Transcript of Analyzing the efficiency of Ajax Liang Zhou [email protected].

Page 1: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

Analyzing the efficiency of Ajax

Liang [email protected]

Page 2: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.
Page 3: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

Evaluation criteria• Bandwidth consumed for the entire task• Time spent waiting for data to be

transmitted• Time spent completing a particular task

Page 4: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

Testing• Testing environment A computer with a Intel Pentium M 1700MHZ CPU and 1000MB Memory running Windows XP SP2 as server machine, the client machine is similar. There is one wireless router between these two machines.• Testing toolMicrosoft Web Application Stress ToolDynaTrace Ajax Edition

Page 5: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

Sample applications

Page 6: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

Socket StatisticsAjax version application

Traditional application

Socket connects 812 530

Total Bytes Sent (in KB)

386.11 386.11

Bytes Sent Rate (in KB/s)

6.36 6.36

Total Bytes Recv (in KB)

1658.03 1658.03

Bytes Recv Rate (in KB/s)

27.32 27.32

Socket StatisticsAjax version application

Traditional application

Socket connects 3216 906

Total Bytes Sent (in KB)

1410.14 648.53

Bytes Sent Rate (in KB/s)

22.94 10.61

Total Bytes Recv (in KB)

1258.99 1591.33

Bytes Recv Rate (in KB/s)

20.48 26.04

Page 7: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

Ajax Traditional

1.80KB 3.13KB

The average number of bytes received in a single request

Ajax Traditional

0.39KB 1.76KB

Page 8: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

Time to first byte(in milliseconds)

Ajax version application

Traditional application

Average 345.51 32.26

Min 2.80 2.77

25th Percentile 212.45 3.74

50th Percentile 222.89 5.28

75th Percentile 358.24 12.30

Max 12822.39 3056.93

Time to last byte (in milliseconds)

Ajax version application

Traditional application

Average 411.83 1679.15

Min 197.10 1224.97

25th Percentile 214.56 1468.33

50th Percentile 224.53 1494.25

75th Percentile 362.81 1706.01

Max 13878.91 6226.26

Time to first byte(in milliseconds)

Ajax version application

Traditional application

Average 282.60 22.80

Min 5.61 2.89

25th Percentile 201.30 3.88

50th Percentile 216.89 5.70

75th Percentile 245.93 14.61

Max 12822.39 3008.00

Time to last byte (in milliseconds)

Ajax version application

Traditional application

Average 1845.36 2909.70

Min 230.25 1340.82

25th Percentile 1471.19 2726.35

50th Percentile 1503.67 2776.81

75th Percentile 1770.07 2948.52

Max 9120.46 6331.80

Page 9: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

Application Average TTFB (ms) Average TTLB (ms)Average Transmission

Time (ms)

Ajax version application 345.51 411.83 66.32

Traditional application 32.26 1679.15 1646.89

Application Average TTFB (ms) Average TTLB (ms)Average Transmission

Time (ms)

Ajax version application 282.60 1845.36 1562.76

Traditional application 22.80 2909.70 2886.90

The average time spent on data transmission

Page 10: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.
Page 11: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

Ajax may slow down the browser

• Ajax enable us to fire request off excessively

• Many JavaScript running time slow① The DOM operation is known to be slow② Many other JavaScript is slower than Java/c#,

and php.

Page 12: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

Test result on Google Search

Version (ms) TTLB (ms)

(ms) OverallTime(ms)

Ajax version

0 396.90 121.40 518.30

Non-Ajax version

0 465.06 N/A 465.06

Page 13: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

Another issue revealed by the experiment

• Ajax enable us to fire request off excessively

Page 14: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

Conclusion

• Ajax reduced the number of data transmitted• Ajax saved the transmission time remarkably• the use of the Ajax should be on a case by case

basis

Page 15: Analyzing the efficiency of Ajax Liang Zhou lz2276@columbia.edu.

References

• [1] Jesse James Garrett, Ajax: A New Approach to Web Applications, Feb 2005

• [2] David Teare, An introduction to Ajax, Dev2Dev, Aug 2005

• [3] Brett McLaughlin, Mastering Ajax part1, IBM, Dec 2005• [4] Chris Schalk, A Hype-Free Introduction to Ajax, Oracle,

April 2006• [5] W3shool JavaScript Tutorial• http://www.w3school.com.cn/js/• [6] Dennis Lembree, Ajax and Web Accessibility, Nov 2008• [7] W3school Ajax Tutorial• http://www.w3schools.com/ajax/default.asp