High Performance JavaScript book review
written by craig, 13 September 2010
“High Performance JavaScript” is a 202-page book aimed at intermediate to advanced JavaScript developers. However, everyone will learn something no matter what their programming background.
JavaScript has evolved. Ten years ago it was ridiculed as a kiddies scripting language (it’s name did much damage) but primarily because browsers were a hostile development environment. The rise of Ajax and Web2.0 applications led to a rediscovery of the language. Many developers, including myself, love JavaScript but it’s still widely misunderstood and misused.
Large web applications now contain many megabytes of JavaScript code. Engines are improving, but performance and optimisation remain a concern for every front-end developer. Could Nicholas C Zakas’s book be the answer?
Chapter 1 provides an important overview of how JavaScript is loaded and when scripts are run. Standard end-of-page techniques are discussed and Zakas recommends several non-blocking patterns to ensure the browser remains responsive while code loads in the background.
The second chapter throws the reader into complex areas such as scope, identifier resolution, closures, prototype chains and memory management. I suspect many will skip the section, but it provides useful background information.
Chapter 3 discusses DOM methods, innerHTML, node access, modification, HTML collections, events and animation. For me, this was the most interesting and useful section of the book. For example, did you realise that standard DOM methods are catching innerHTML and can be faster in webkit browsers?
The fourth chapter covers standard programming methodology including algorithms, loops, conditions, iteration and recursion. Efficient, good-practise techniques are discussed and many will apply to any programming language.
Chapter 5 delves the reader into string manipulation and includes an 18-page in-depth analysis of regular expressions. Like many, I often use the force when creating complex regexs and rarely consider operational efficiency. Zakas describes how they work and what you can do to improve their speed — again, essential reading for any web developer.
Chapter 6 is titled “Responsive Interfaces” and discusses browser UI threads, timers, split processing and the new HTML5 web workers API. Application developers will find the information increasingly useful as the processing burden moves from the server to the client.
The following chapter is dedicated to Ajax and compares the various techniques and data transport options such as HTML, XML, JSON, and custom formats. Although I found little new, there were still nuggets of information which will change the way I approach Ajax-powered applications.
The book finishes with Programming Practices — another informative section which could apply to any discipline. The final chapters (written by other contributers) cover building, deployment, pre-processing, minification, caching, CDNs, and profiling tools.
High Performance JavaScript is an excellent book. It’s concise, well-written, and matched — if not exceeded — my expectations. JavaScript optimisation is a hot-topic and I’d recommend it to all front-end developers.
- categories: javascript
- trackback: http://www.optimalworks.net/blog/2010/web-development/javascript/high-performance-javascript-review/trackback
- bookmark: del.icio.us, digg, facebook, twitter, reddit, Furl, Spurl, Blinklist, Slashdot, Technorati, Yahoo!

one comment:
25 March 2011 Web Deisgn Surrey commented