> For the complete documentation index, see [llms.txt](https://mango-5m.gitbook.io/mango5m-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mango-5m.gitbook.io/mango5m-docs/resources/mango-radio/reference/performance.md).

# Performance

What runs, when it runs, and what it costs when it does not.

Mango Radio is built so that a player who never touches the radio pays nothing for it.

## On foot

Nothing runs. The idle threads sleep between 400 and 700 milliseconds and do no work beyond checking whether you are in a vehicle.

## In a vehicle

One lightweight per-frame loop, whose only job is to keep GTA's stock radio wheel and next/previous controls disabled so this system fully replaces them.

A second loop runs at half-second intervals to notice the station changing — including changes made by other scripts — and to keep the now-playing information current. It only sends anything to the interface when something is actually on screen.

## While a surface is open

The carousel runs one animation loop while visible and stops it entirely when it hides. It renders only the stations actually on screen, not the whole list.

The station browser is removed from layout entirely while closed — no animations, no timers, nothing painting. The 3D tilt loop only runs while the panel is open and in cursor mode.

## Broadcast range

The range thread idles unless you are in a vehicle tuned to a station that actually defines coverage. Only then does it tick at `checkInterval` (default 700 ms).

The static engine is created on first use and **suspended** as soon as the signal is clean, so in-range driving costs nothing at all.

## Media Player

The server scheduler is a single timer that fires once per track — not a polling loop — and broadcasts a small payload only on an actual track change. A player not tuned to the station does no work for it.

Each listener re-checks its position every ten seconds, which is a tiny message and a comparison that usually changes nothing.

## Artwork and colour analysis

The dominant-colour analysis runs **once per station**, when that station's image loads. The colour ring itself is pure CSS on a single element, so it costs nothing per frame no matter how long it spins.

## Sizing

Everything is measured in `vh`, so there is no resize handling, no media queries and no recalculation on resolution change.
