High Performance JavaScript

Author: Nicholas C. Zakas
Publisher: Yahoo Press,2010
Pages: 240
ISBN: 978-0596802790
Aimed at: IntermediateJavaScript programmers
Rating: 4.5
Pros: An in-depth approach to optimisation
Cons: Tendency to obsessive detail
Reviewed by: Ian Elliot

In in-depth look at Javascript's inner workings - does it  go too far?

 

Author: Nicholas C. Zakas
Publisher: Yahoo Press,2010
Pages: 240
ISBN: 978-0596802790
Aimed at: Intermediate JavaScript programmers
Rating: 4.5
Pros: An in-depth approach to optimisation
Cons: Tendency to obsessive detail
Reviewed by: Ian Elliot

This is a slim book on how to write efficient Javascript. Most of the advice it gives is well known to Javascript experts but it could be better known by every Javascript programmer. Many of the chapters the introduce and discuss the ideas in depth could really be reduced to a single recommendation or at most a set of bullet point of do and don'ts. The fact that things are explained in so much detail might irritate some users but personally I enjoyed reading about the inner workings of the language. 


Banner

Chapter 1 deals with the well known and standard problem of maximising Javascript load speeds and avoiding blocking the browser. From here we move to optimising access to variables and in-memory data in general. Then on to DOM scripting, what makes DOM access fast and how to avoid updating the DOM with small fragments of code.

Chapter 4 is a fairly conventional look at optimising the flow of control - which loop is fastest type of discussion. Chapter 5 is about strings and regular expression and given that most Javascript spends a lot of time on strings this is valuable. Chapter 6 takes us inside the browser to look at the way Javascript interacts with its UI thread. The basic idea is to yield every now and again to let the UI thread attend to other things by the use of timers.

Next we have the inevitable chapter on Ajax which takes the form of an introduction to Ajax with a few comments on caching and a list of best practices. Chapter 8 deals with to sorts of optimisations that you would find appropriate to almost any language and the final two chapter round up with a look at building and deploying Javascript apps and Tools that you can use as part of optimisation.

There is nothing truly new in this book but it is nice to have it all collected together in one place. At the end of the day however, apart from non-blocking and optimised downloading of scripts, I'm not convinced that you need to be too obsessive about optimisation. Most of the time the differences are slight - unless the problem code is in a loop which multiplies any inefficiencies by the number of times it loops.

This isn't a book for the beginner and it isn't for you if you don't want to have the ideas explained to you. You can learn a lot about Javascript from the details of how the performance enhancements work - but if you just want a list of best practices this might seem like a lot of work to get to the punch line.

With these slight reservations the book is still highly recommended.

Banner


SQL Server 2022 Query Performance Tuning (Apress)

Author: Grant Fritchey
Publisher: Apress
Pages: 745
ISBN:978-1484288900
Print:1484288904
Kindle:B0BLYD98SQ
Audience: DBAs & SQL Devs
Rating: 4.7
Reviewer: Ian Stirk 

A popular performance tuning book gets updated for SQL Server 2022, how does it fare?



C++ Programming, 6th Ed (In Easy Steps)

Author: Mike McGrath
Publisher: In Easy Steps
Date: April 2022
Pages: 192
ISBN: 978-1840789713
Print: 1840789719
Kindle: B09V2T9SJD
Audience: Developers wanting to learn C++
Reviewer: Mike James
This is the 6th edition of a slim book on C++. Can you really learn C++ in easy steps?


More Reviews

Last Updated ( Friday, 06 January 2012 )