Å·±¦ÓéÀÖ

Jump to ratings and reviews
Rate this book

High Performance JavaScript: Build Faster Web Application Interfaces

Rate this book

If you're like most developers, you rely heavily on JavaScript to build interactive and quick-responding web applications. The problem is that all of those lines of JavaScript code can slow down your apps. This book reveals techniques and strategies to help you eliminate performance bottlenecks during development. You'll learn how to improve execution time, downloading, interaction with the DOM, page life cycle, and more.

Yahoo! frontend engineer Nicholas C. Zakas and five other JavaScript experts -- Ross Harmes, Julien Lecomte, Steven Levithan, Stoyan Stefanov, and Matt Sweeney -- demonstrate optimal ways to load code onto a page, and offer programming tips to help your JavaScript run as efficiently and quickly as possible. You'll learn the best practices to build and deploy your files to a production environment, and tools that can help you find problems once your site goes live.

Identify problem code and use faster alternatives to accomplish the same task Improve scripts by learning how JavaScript stores and accesses data Implement JavaScript code so that it doesn't slow down interaction with the DOM Use optimization techniques to improve runtime performance Learn ways to ensure the UI is responsive at all times Achieve faster client-server communication Use a build system to minify files, and HTTP compression to deliver them to the browser

232 pages, Paperback

First published January 1, 2010

41 people are currently reading
1,268 people want to read

About the author

Nicholas C. Zakas

17?books106?followers
Chinese: Äá¹ÅÀ­Ë¹

Nicholas C. Zakas is a front-end consultant, author, and speaker. He worked at Yahoo! for almost five years, where he was front-end tech lead for the Yahoo! homepage and a contributor to the YUI library. He is the author of Maintainable JavaScript (O¡¯Reilly, 2012), Professional JavaScript for Web Developers (Wrox, 2012), High Performance JavaScript
(O¡¯Reilly, 2010), and Professional Ajax (Wrox, 2007). Nicholas is a strong advocate for development best practices including progressive enhancement, accessibility, performance, scalability, and maintainability.

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
221 (37%)
4 stars
242 (40%)
3 stars
109 (18%)
2 stars
23 (3%)
1 star
1 (<1%)
Displaying 1 - 30 of 36 reviews
Profile Image for Rob.
Author?2 books428 followers
April 14, 2010
While reading Nicholas Zakas' High Performance JavaScript, it occurred to me that there were actually two different reviews that I wanted to write. So, rather than try to reconcile them into one review, I'll simply apply them here as an ordered list.

(1) To continue with the JavaScript University metaphor (from my review of Zakas' ): Finals are coming up in . You've been a diligent student all semester and although you're not failing, it always seems like you're somewhere in the middle of the pack. You want desperately to ace the final exam, so you reach out for some help. Zakas (the graduate student/teaching assistant for the class) offers to show you the thesis he is working on. Then It hits you like a bolt from the blue -- every bit of it resonates with you. "It's so simple! so clear!" you exclaim. The inner machinations of the language snap together in a way that makes it all feel new and exciting -- the possibilities are boundless! You go back over your notes. You were close -- oh so close -- the whole time. But the last little bits drop in. A refinement here, a re-factor there... and the next thing you know, things are blazing. Your pages load 60% faster, execution time is down an average of 40%. You're amazed at yourself. And when the grades for the final exam come back, you're pleased to see that you aced it (aside from that little Oops on scoping closures -- but you try to think of that as a conscious trade-off). Prof. Crockford is pleased (if a little disappointed that it took you this long to Get It) and you're the envy of your peers. At least until next semester's RegEx class with Prof. Levithan. [ Rated: ¡ï¡ï¡ï¡ï¡ï ]

(2) The frustrating part about working at a well-organized shop is that you get yourself all excited for a book like this and then half the recommendations in there are things that you're already doing. Put scripts at the bottom of the document? Check. Minify and compress? Check. Concatenate and package? Check. So on the one hand you say: "I guess I can sleep a little easier at night knowing that our build system adheres to the best practices recommended by the experts out there." But on the other hand, you're a little disappointed because you were hoping for some startling revelations. Again: not that this makes it without merit. From this perspective, what is noteworthy about this book is that these best practices and techniques are all gathered up in one place and presented in a logical order; even if "you're already doing it right", it is still a worthwhile exercise to meditate on the specifics, and to really go deep on why these best practices are important. (Plus, it's great to see the data -- nothing beats a little chartporn for proving the point.) [ Rated: ¡ï¡ï¡ï¡ï ]
Profile Image for Jamison.
21 reviews50 followers
September 22, 2012
Full of outdated advice and old benchmarks. It wasn't really what I was looking for. If you are working with IE 6, then there are some valuable tips, but if you are not and have some experience developing JavaScript, there is not much new here.
Profile Image for Daniel R..
219 reviews13 followers
February 29, 2016
I've routinely seen this book on short-lists of must read JavaScript books. I unfortunately waited too long to read it. As the foreword notes at the time the book was written the browser landscape was drastically different than it is as we start 2016. Certain chapters still hold relevant nuggets of advice but overall this book is no longer a must read, in particular all of the browser benchmarks need to be rerun on modern browsers. Loading and Execution is still important but doesn't cover newer libraries. The improvements in JIT make most of the Data Access chapter questionable. DOM Scripting advice still holds true and is a driver behind libraries like React. Most of Algorithms and Flow Control and Strings and Regular Expressions is still relevant, especially issues with backtracking. Responsive Interfaces and Programming Practices have some good ideas. The Ajax chapter is mixed and doesn't include WebSockets as a transport mechanism. Building and Deploying High-Performance JavaScript Applications is completely outdated given the rise of Node.js. Tools has some good ideas but doesn't cover newer browser debugging and profiling capabilities.
Profile Image for Dan.
230 reviews168 followers
Read
January 21, 2013
A disappointment, but mostly due to its age. When a book features performance testing of Google Chrome versions 1 and 2, you know something's off. Finally forced myself to finish reading it, but found little of value in the back half of the book. The problem is that almost everything in the book is a well-established best practice now, and if you're even moderately up-to-date on writing good JavaScript, the book is almost all repetition.

That said, the big payoff was Chapter 3. Here is where the DOM interaction comes into play, and the ideas of repainting and reflowing the page were examined. There are also some interesting parts in Ch 5 (regexes) and 6 (timers) if you're not already familiar with the performance aspects of those features.

I'd recommend intermediate and some advanced JS folks to skim certain chapters; just watch out for the speed tests -- use jsperf.com instead!
Profile Image for Steve.
23 reviews
September 6, 2022
This isn't a knock on the book itself. Honestly, if I had read this when it first came out (2010) it would have been an easy 5! It's very practical, and super informative. However, many of the practices are outdated. For me, this book was more about fundamentals and a historical take on the Javascript performance.
Profile Image for Danial Kalbasi.
49 reviews7 followers
March 5, 2019
This book has few good points, but it almost irrelevant for the existing tech stack. You might get more from google developer website rather than this book in terms of performance.
May 17, 2022
Very outdated book, despite this some of the point are still valid. Almost all of the optimisation points are handled already by some tools and we can see from this book like a history of the optimisation history of the JS.
1 review
August 8, 2018
Excellent in depth look into some performance aspects of JavaScript code that might not be apparent even to weathered users of the language.
Profile Image for Le.
199 reviews2 followers
September 10, 2021
15ÄêµÄÊ飬¾¡¹Ü·Åµ½ÏÖÔÚ£¬ÈÔÈ»Óкܶà¿ÉÒÔ½è¼øµÄµØ·½¡£ÇÔÒÔΪ£ºÇ°8Õ¶¼·Ç³£ÖµµÃ¿´£¬¶ÔÓÚ¹®¹ÌJS»ù´¡ÓкܺõİïÖú£»9, 10ÕµÄÄÚÈݶ¼Ëã±È½Ï¾ÉµÄ¼¼Êõ£¬¿ÉÒÔºöÂÔ~
Profile Image for Ma.
36 reviews6 followers
June 13, 2022
Very good detailed book, though old now. Some insights into JS internals like scopes, activation records, execution context. Recommended.
Profile Image for Ulee ??.
248 reviews24 followers
July 15, 2012
I give it a 3.7. After three or four false starts, I was able to read this book until it was done. I think it took me a while to get into this book because in the beginning it felt like he spent forever just talking about scopes. It could also have been that back then the Nook (Color)? didn't support pdf books as well as it does today. Mostly meaning it didn't save what page you were on last. Every time you open the pdf, it started back at the beginning.

After a few pages, and I was able to get into a groove with the book. I feel like it was a very thorough book in terms of giving you choices on how you can make your code more efficient and why. The only issue I had and he may have mentioned this but I missed it, is that in all his examples you had multiple var declarations in each example. That isn't very efficient. If the code was jslinted, it would have failed. He didn't talk about the different ways of declaring functions and which way is faster and why. Maybe it is out of the scope of this book and it falls under best coding practices. Either way, I would recommend this book.
Profile Image for Tony.
102 reviews
June 27, 2013
This book is not for a beginner in JavaScript. It's intended more as a "best practices" guide for people who are already at least intermediate in the JavaScript skills. If you have a hard time wrapping your head around object-oriented JavaScript and closures, you probably aren't ready for this one, just yet.

The section on regular expressions and how they work, under the hood, was nearly worth the price of admission by itself. I've spent many years working with Perl, had the college-level course in deterministic finite automata, etc. I thought I knew that part frontwards and backwards. I learned even more from this book.

What are the biggest barriers to fast page loading? How you determine which ones are holding up the show with your latest project? It's all in here.

How slow is "slow?" How long can the script engine tie up the CPU before users start perceiving it as "laggy?" It's in here. How do you do long-running tasks without running into that problem? Also in here.

I learned plenty. After reading "JavaScript: the Good Parts" and "Eloquent JavaScript," this should be next on your list.
Profile Image for David Zukowski.
22 reviews12 followers
May 10, 2014
Pretty good reference. I think the book's age (references IE4) actually helps it in some ways, as it discusses guidelines and practices for improved performance on browsers much less powerful than we have now. Most developers should be familiar with the majority of this book (script placement, sync vs async, caching, etc.) but there were plenty of other interesting topics, such as real-world use cases bitwise operators and Duff's device.
Profile Image for Illia Olenchenko.
27 reviews
February 5, 2015
§¬§ß§Ú§Ô§Ñ §à§ä§Ý§Ú§é§ß§Ñ§ñ §Ú §Õ§Ö§Û§ã§ä§Ó§Ú§ä§Ö§Ý§î§ß§à §Õ§Ñ§Ö§ä §á§à§ß§ñ§ä§î §ß§Ñ§ã§Ü§à§Ý§î§Ü§à §Ù§Ñ§Ó§Ú§ã§ñ§ä §à§á§ä§Ú§Þ§Ú§Ù§Ñ§è§Ú§Ú §à§ä §ä§Ú§á§Ñ §à§ê§Ú§Ò§à§Ü §Ú §Ü§Ñ§Ü §Ú§ç §Ý§å§é§ê§Ö §á§â§Ú§Þ§Ö§ß§Ú§ä§î. §¯§Ñ§ã§ä§à§ñ§ë§Ú§Þ §à§ä§Ü§â§í§ä§Ú§Ö§Þ §ã§ä§Ñ§Ý §á§â§Ú§Þ§Ö§â §µ§ã§ä§â§à§Û§ã§ä§Ó§Ñ §¥§Ñ§æ§Ñ, §Ü§à§ä§à§â§í§Û §Õ§Ö§Û§ã§ä§Ó§Ú§ä§Ö§Ý§î§ß§à §ß§Ñ §Ò§à§Ý§î§ê§Ú§ç §Ü§à§Ý-§Ó§Ñ§ç §à§á§Ö§â§Ñ§è§Ú§Û §å§ã§Ü§à§â§ñ§Ö§ä §á§â§à§è§Ö§ã§ã §Ó§í§á§à§Ý§ß§Ö§ß§Ú§ñ §á§à §ã§â§Ñ§Ó§ß§Ö§ß§Ú§ð §ã §è§Ú§Ü§Ý§à§Ó §Ó 2-3 §â§Ñ§Ù§Ñ. §´§Ñ§Ü §Ø§Ö §à§é§Ö§ß§î §Ú§ß§ä§Ö§â§Ö§ã§ß§í§Ö §á§à§ã§Ý§Ö§Õ§ß§Ú§Ö 2 §Ô§Ý§Ñ§Ó§í §à§Ò §Ú§ß§ã§ä§â§å§Þ§Ö§ß§ä§Ñ§ç §Ú §ã§á§à§ã§à§Ò§Ñ§ç §á§à§ã§ä§â§à§Ö§ß§Ú§ñ §á§â§à§Ö§Ü§ä§à§Ó. §°§ä§Ý§Ú§é§ß§Ñ §ß§Ñ§á§Ú§ã§Ñ§ß§Ñ §é§Ñ§ã§ä§î §á§â§à §â§Ö§Ô§å§Ý§ñ§â§ß§í§Ö §Ó§í§â§Ñ§Ø§Ö§ß§Ú§ñ. §²§Ö§Ü§à§Þ§Ö§ß§Õ§å§ð.
379 reviews9 followers
June 13, 2011
Un ottimo testo, con moltissime informazioni utili e chiare sulle capacit¨¤ e le compatibilit¨¤ dei maggiori browser (IE, Firefox, Safari, Chrome in diverse versioni). Molti dei consigli, soprattutto nella prima parte del libro, per migliorare prestazioni e interattivit¨¤ sono validi anche in altri linguaggi, sia lato server che general purpouse.
45 reviews2 followers
May 15, 2015
at least 5 stars.
it is attractive for me at some charpters:
it introduce Strings optimize
data format performance
loops and conditionals optimize,
timer
data access contain closures
dom,
many ways are applicative and i can correct my previous useage of bad performance,
so i give the book 5 stars,and it is understandable.
Profile Image for Nick Carter.
32 reviews2 followers
February 22, 2012
Though about half the book is rehash for experienced javascripters, it's nice to have all these tips in one place, and Zakas gives several topics (loop unrolling, local caching) better coverage than any I've read elsewhere.
Profile Image for Nate Berggren.
4 reviews1 follower
March 9, 2013
I'd rate this book 4 stars if it weren't so dated (read it in 2013). It is still a good read and gives a good perspective on the path javascript development is on. It also did spark some good discussions among my coworkers and jump-started our conversation on coding standards.
Profile Image for Iman Mh.
10 reviews1 follower
October 15, 2013
Just an other awesome book by Nicolas Zakas. The first 3 chapters are critically important for every project. If you are going to build javaScript applications that requires a high amount of resources this book is the number one to read.
Profile Image for Steve Love.
100 reviews7 followers
December 28, 2010
Excellent consolidation of a wide range of tips and tools for optimizing JavaScript and the loading of JavaScript resources. If you work with JavaScript, you should read this.
Profile Image for Nicklas.
24 reviews
May 27, 2013
Some general good advices and tips on the JS internals and what to think about to make it scale.
Profile Image for Timo.
37 reviews
April 5, 2013
Lots of useful tips and hints to improve your (native javascript) code ja regex performance. Tools section is outdated but still points to the right direction.
Profile Image for Katherine.
149 reviews
June 13, 2014
Requires updates. Reading Google's JavaScript Style Guide is more beneficial.
Displaying 1 - 30 of 36 reviews

Can't find what you're looking for?

Get help and learn more about the design.