GPU acceleration

Also called hardware acceleration or compositing

A browser technique where the graphics chip moves, fades, or scales an element on its own layer instead of redrawing the page every frame.

What is GPU acceleration?

Browsers draw a page in stages: calculate styles, lay out the boxes, paint the pixels, then composite the painted layers into the final image. Some elements get their own layer, a separate bitmap that the GPU can move around cheaply. When an animation changes only transform or opacity on such a layer, the browser can usually skip layout and paint and just composite again.

That is why the standard advice for smooth motion is to move things with translate() instead of top or left, resize them with scale() instead of width and height, and fade them with opacity. CSS transitions and animations of these properties can often keep running smoothly even while JavaScript is busy.

Layers are not free. Each one keeps its own bitmap in memory, and too many slow the page down, especially on phones. Old tricks like adding translateZ(0) to everything create layers you may not need. Let the browser promote what animates, and check the Layers panel in Chrome DevTools when you are unsure.

Often confused with

will-change
will-change is a hint that asks the browser to prepare a layer ahead of time. GPU acceleration is the compositing work itself.
All terms

will-change

A CSS property that tells the browser an element is about to animate, so it can prepare, often by giving the element its own layer ahead of time.

Layout thrashing

A slowdown caused by code that alternates style changes with size reads, forcing the browser to recalculate layout many times in one frame.

Jank

Visible stutter in an animation or scroll, caused when the browser misses frames because it cannot finish its work in time.

Translate

A CSS transform that moves an element along the x or y axis while the layout around it stays exactly where it was.