Skip to content

Performance

Where the 16.67 ms of a frame go, and the standard ways to spend less of them.

7 cheat sheets · 3 subcategories

CPU

Budgeting and spreading work across frames.

Interactive visual
core

Frame Budget

every system shares one slice of time per frame

At 60 Hz a frame has 16.67 ms for input, gameplay, physics, AI and rendering combined. Measure each system and keep the total under budget with headroom.

Interactive visual
common

Time Slicing

let a different group think each frame

Split expensive per-entity work into buckets and run one bucket per frame. Cost per frame drops by the bucket count; each entity reacts a little later.

GPU

Fewer draw calls, fewer overdrawn pixels.

Interactive visual
core

Draw Calls

draw a thousand things in one request

Each mesh costs the CPU a draw call plus state changes. Instancing and batching turn thousands of identical objects into one call; track renderer.info.

Interactive visual
common

Overdraw

every layer on a pixel is paid for again

Overdraw is shading the same pixel more than once. Stacked transparent particles and big quads multiply fill cost; trim sprites and limit layers.

Interactive visual
common

Texture Atlas

many images, one texture, one material

Pack many sprites into one texture and address each by its UV rectangle, so objects share a material and batch into few draw calls. Pad to stop bleeding.

World

Organising large worlds in space and memory.

Interactive visual
advanced

Chunk Streaming

keep only the world around the player in memory

Split a big world into chunks, load those within a radius of the player and unload them past a larger radius, so the boundary never thrashes.

Interactive visual
core

Spatial Partitioning

only compare things that are near each other

Bin objects into a uniform grid so collision and proximity queries test only same-cell and neighbour-cell pairs instead of all n(n−1)/2 pairs.