- Tutorials
- JavaScript Tutorial
- JavaScript Performance
JavaScript Performance
7 lessonsAbout 42 minutesAdvanced
This part of the JavaScript Tutorial runs from JavaScript Performance Basics through to JavaScript Reflect. There are 7 lessons here, and working through them takes about 42 minutes at a steady pace.
It follows on from JavaScript Generators & Iterators, so finish that first if you have not already — the examples below assume you are comfortable with it.
Each lesson below says what it covers before you open it. Read them in order the first time; afterwards this page works as a index you can jump back into when you need to check one thing.
- 1JavaScript Performance BasicsFast code starts with measuring, not guessing where the slow part is.
- 2JavaScript DebounceDebouncing delays a function until the calls have stopped for a while.
- 3JavaScript ThrottleThrottling limits a function to running at most once in a given time window.
- 4JavaScript MemoizationMemoization caches a function's results so the same input never does the same work twice.
- 5JavaScript Performance Measurementperformance.now gives a far more precise timestamp than Date.now for measuring code.
- 6JavaScript ProxyA Proxy wraps an object and lets you intercept what happens when it is used.
- 7JavaScript ReflectReflect provides the same operations as a Proxy trap, as plain functions you can call directly.
