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


Killer ChatGPT Prompts (Wiley)

Author: Guy Hart-Davis
Publisher: Wiley
Pages: 240
ISBN: 978-1394225255
Print: 1394225253
ASIN: B0CF3WFTWM
Audience: Everyone
Rating: 5
Reviewer: Ian Stirk

This book aims to get optimal answers to your questions from ChatGPT, how does it fare? 



Grokking Machine Learning

Author: Luis G. Serrano
Publisher: Manning
Date: December 2021
Pages: 512
ISBN: 978-1617295911
Print: 1617295914
Kindle: B09LK7KBSL
Audience: Python developers interested in machine learning
Rating: 5
Reviewer: Mike James
Another book on machine learning - surely we have enough by now?


More Reviews

Last Updated ( Friday, 06 January 2012 )