Learn JavaScript

Lesson 3 of 9 · Performance, Memory, Debugging and the Interview Output Puzzles

Module 17 · Performance, Memory, Debugging and the Interview Output Puzzles

Seven Programs That Measure, Compare and Fix

ProReading

Lesson 01 gave you the habit and Lesson 02 the tools. This lesson is the workshop. Each program here is complete and short, and each one answers a real question by measuring it. Some answers will surprise you, and one of them surprised Kenji.

Checking what this lesson needs for you…

What is inside Seven Programs That Measure, Compare and Fix

  1. One rule for every program here
  2. A benchmark helper
  3. includes against a Set
  4. shift against a head index
  5. += against join
  6. A memo that counts its calls
  7. A leak and its fix
  8. The track's numbers in one chart