Loop Optimization--Part 3 of Chapter 10 from Speed Up Your Site (6/6)--WebReference.com | WebReference

Loop Optimization--Part 3 of Chapter 10 from Speed Up Your Site (6/6)--WebReference.com

To page 1To page 2To page 3To page 4To page 5current page
[previous]

Speed Up Your Site, Chapter 10: Optimizing JavaScript for Execution Speed

Summary

To speed execution, optimize your code at the right design level or combination of levels. Start with global optimizations first (for example, algorithm and data structure choices), and then move down toward more local optimizations until your program is fast enough. Refactor to simplify your code, and then minimize DOM interaction and I/O requests. Finally, if all else fails, tune your code locally with the techniques outlined in this chapter. Measure each change, and cool hot spots one at a time. Here is a summary of the optimization techniques discussed in this chapter:


Recommended Reading - If you want to learn more about optimizing JavaScript, I recommend these sources:

  • Jon Bentley's Programming Pearls, 2nd ed. (Addison-Wesley, 1999) and More Programming Pearls: Confessions of a Coder (Addison-Wesley, 1988). These books include many examples of code tuning and recap the 27 code-tuning rules in his out-of-print classic, Writing Efficient Programs.

  • Brian Kernighan and Rob Pike's The Practice of Programming (Addison-Wesley, 1999) describes best programming practices, including Chapter 7 on performance.

  • Donald Knuth's The Art of Computer Programming series (Addison-Wesley, 1998).

  • Steve C. McConnell's Code Complete: A Practical Handbook of Software Construction (Microsoft Press, 1993), especially Chapters 28 and 29.

# # #

[Andy King is the founder and newsletter editor of WebReference.com. The companion Web site for this book can be found at: www.websiteoptimization.com.]


To page 1To page 2To page 3To page 4To page 5current page
[previous]

Created: January 27, 2003
Revised: January 27, 2003

URL: http://webreference.com/programming/optimize/speedup/chap10/3/6.html