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


The AWK Programming Language, 2nd Ed

Author: Alfred V. Aho, Brian W. Kernighan and Peter J. Weinberger
Publisher: Addison-Wesley
Pages: 240
ISBN: 978-0138269722
Print: 0138269726
Kindle: B0CCJ1N4X3
Audience: Developers interested in Awk
Rating: 5
Reviewer: Kay Ewbank

The name Brian Kernighan among the authors of this updated classic raises  [ ... ]



ChatGPT For Dummies

Author: Pam Baker
Publisher: For Dummies
Pages: 176
ISBN: 9781394204632
Print: 1394204639
Kindle: B0C63LZ6DN
Audience: Everyone
Rating: 4
Reviewer: Ian Stirk

 


This book aims to introduce you to ChatGPT, how does it fare?


More Reviews

Last Updated ( Friday, 06 January 2012 )