Author: Tom Barker
Reviewer: Ian Elliot
Chapter 3 continues in the theme of benchmarking pages with a look at WPTRunner to automate performance testing. There is some more R and lots of listings that aren't particularly interesting or relevant. The chapter ends with an interview with the creator of WebPagetest. At this point you start to think that perhaps there isn't quite enough material to fill a book as thin as this 200 page volume.
Chapter 6 is the first that actually considers in detail what you might do to optimize page loading. It starts off with a look at how a page is rendered in detail. Next we look at script loading and async and spend a few pages working out how to measure the difference in speed. If the results were presented without the discussion of how they were arrived at this would be a very short chapter.
The section on the cost of nested loops left me completely mystified. It starts with
"We know loops in general cost more in performance than unfurling the code and executing it sequentially. This is because each loop is synchronous and blocks execution of the rest of the application until it is complete"
The final chapter looks at balancing performance with code quality. This, of course, is the reason you should never optimize code because it makes it less readable. After a look at the idea of stripping out all the functions and modularity and writing your program as one big unreadable chunk, the chapter moves on to using the Closure compiler to do many of the same things but automatically. Here we are treated to a large listing of the sort of unreadable code that Closure creates - a few lines would have been fine but not the more than two pages allocated.
Only buy this if you want to know how to benchmark a web page.