O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JavaScript High Performance

Video Description

Leverage the power of several performance enhancing coding techniques in JavaScript and take your app to the next level

About This Video

  • Analyze and resolve high performance related issues in JavaScript programming

  • Master the skill of referring to functions, classes, and dealing with loops and arrays productively

  • Work around DOM and CSS elements to keep the balance between app efficacy and animation

  • In Detail

    One of the most common challenges JavaScript developers face is creating a number of applications and maintaining them to run smoothly. The aim of this course is to deliver critical tips and techniques to help you create smarter and faster applications.

    JavaScript High Performance focusses on making your JavaScript code run more efficiently, raising your app performance.

    Start off by minifying and caching your code, be it JavaScript, HTML or CSS. Walk through different methods including creating location references, condensing var definitions and so on, helping you gain a solid foundation of the basic practical approaches. Next, discover the most potent ways to refer to functions and classes, learn how to streamline loops and arrays, and detect and avoid any memory leaks. Also, improve the appearance of your app by using sleek animations, without compromising performance.

    By the end of this course, you’ll be confident in dynamically improving the performance of your app.

    The course follows a strict hands-on approach and introduces you to various methods which will help you maintain and rev-up your JavaScript based app. Using bad sample code, learn various ways to transform code and discover how to implement this yourself in your own app.

    Table of Contents

    1. Chapter 1 : Minifying and Caching Your Site
      1. Course Overview 00:02:02
      2. Caching Your Scripts 00:11:12
      3. Creating a Cache Buster 00:04:58
      4. Minifying Your Output 00:09:02
    2. Chapter 2 : Covering the Foundations
      1. Always Declare Your Variables 00:03:18
      2. Creating Location References 00:09:02
      3. Condensing var Definitions 00:05:00
      4. Comparing Explicitly When Appropriate 00:02:53
      5. Using String Accumulator-style 00:03:26
      6. Building Strings with Arrays 00:03:12
    3. Chapter 3 : Going Beyond the Basics
      1. Avoiding eval for Object References 00:04:05
      2. Talking to Functions 00:02:13
      3. Avoiding eval 00:04:48
      4. Reducing the Use of Anonymous Functions 00:03:24
      5. OOP – Defining Class Methods and Properties 00:03:55
    4. Chpater 4 : Looping, Arrays, and Conditions
      1. Picking the Right Loop for the Task 00:02:30
      2. Simplifying Your Loops – Round 1 00:05:12
      3. Reducing the Loop Footprint 00:09:31
      4. Loops, Arrays, and Memory Leaks 00:05:21
      5. Preallocating Size to an Array 00:09:15
      6. Avoiding the Unnecessary 00:08:43
      7. Putting Code Where It Should Be 00:08:30
    5. Chapter 5 : Optimizing Events and Time
      1. Clearing Circular References 00:10:49
      2. Using Less Events to Do More 00:08:10
      3. Trading Smoothness for Speed 00:07:12
      4. Clearing Memory Leaks by Always Clearing Intervals 00:03:04
      5. How to Avoid Running Multiple Intervals 00:12:53
    6. Chapter 6 : The DOM and CSS
      1. Reducing DOM Calls 00:13:24
      2. Reducing Document Reflows 00:07:00
      3. Making It Animate Smoothly 00:11:31
      4. Changing Classes and Not Styles 00:07:11
      5. Adding Scripts as You Need Them Dynamically 00:04:07
    7. Chapter 7 : Data and leaks
      1. Cutting Traveling with HTML5 Validation 00:04:45
      2. Moving Data Processing to the Client Side 00:09:41
      3. What Data Types to Use? 00:01:24
      4. Caching Data 00:01:45
      5. The Issue with Working Directly with HTML Collections 00:04:44
      6. Converting Collection Objects into Arrays 00:03:22
      7. FPS and High Resolution Time – HRT 00:16:52
      8. JavaScript Profiling and Memory Leaks 00:05:31