Skip to main content

JavaScript for Frontend Performances

JavaScript performance work reduces how much code is downloaded, parsed and executed. Techniques include code splitting, tree shaking, removing unused dependencies, and keeping the main thread free by breaking long tasks, deferring non-urgent work and moving heavy computation to web workers.

Stage: Runtime · Part of the Frontend Performance roadmap · Last reviewed 19 November 2026

What to learn in JavaScript

JavaScript interview questions

What is tree shaking and what can stop it working?

Tree shaking removes exports that nothing imports, using the static structure of ES modules. It fails with CommonJS modules, side-effectful imports not marked in package.json sideEffects, or code that touches the module in dynamic ways.

What counts as a long task and why does it matter?

A long task is main-thread work that runs for more than 50 milliseconds without yielding. While it runs the browser cannot respond to clicks or paint, so long tasks directly hurt Interaction to Next Paint and make the page feel frozen.

Where JavaScript fits in the Frontend Performance roadmap

JavaScript belongs to the Runtime stage (intermediate level), which takes about 10 hours. Keep it smooth.

Back to the full Frontend Performance roadmap