# How to benchmark realtime avatar startup and turn latency

> A reproducible measurement protocol for avatar startup, first audible reply, interruptions and failures, with downloadable Next.js instrumentation and reporting guidance.

- Published: 2026-09-05
- Tags: api, engineering
- Canonical: https://realtimeavatar.ai/blog/how-to-benchmark-realtime-avatar-startup-and-turn-latency
- Markdown: [en](https://realtimeavatar.ai/blog/how-to-benchmark-realtime-avatar-startup-and-turn-latency.md)

“Avatar latency” can mean time to join a room, see a frame, hear a reply or stop an interrupted reply. Those numbers answer different questions. Before comparing APIs, define the event that starts each timer and the observation that stops it.

This article publishes a measurement protocol and runnable startup instrumentation. It contains no live-call latency results or cross-vendor ranking. The [Next.js starter](https://realtimeavatar.ai/downloads/nextjs-avatar-starter.zip) lets you collect observations on your own account and network.

## Measure distinct paths

| Metric | Start | End | What it includes |
| --- | --- | --- | --- |
| Click to SDK live | User clicks Start | SDK reports live | Application and connection readiness; not proof of a displayed frame. |
| Click to first remote frame | User clicks Start | First observed presented frame from the remote MediaStream | Queue, setup, transport, decoding and browser presentation. |
| Spoken-turn response | Last audible sample of the user's utterance | First audible sample of the avatar's reply | Endpointing, recognition, model response, synthesis, transport and playback. |
| Interruption stop | User begins speaking over the avatar | Avatar audio stops | Detection, cancellation and buffered playback. |

Use one monotonic clock for elapsed times. Server and browser wall-clock timestamps may have different offsets. A server-side processing duration can help diagnose one stage, but it cannot replace a browser observation of the complete path.

## Collect startup observations with the starter

Follow the [setup instructions](https://realtimeavatar.ai/docs/nextjs), keep the tab in the foreground, start a call, then download its JSON after ending. The app records `sdkLiveMs`, `firstVideoFrameMs`, start date, browser, SDK version and end reason. A missing timing is `null`, not zero. There is no API key, room token or transcript in the download.

The video observation uses `requestVideoFrameCallback` on a video element backed by a `MediaStream`, so a poster or idle clip does not count. A 50 ms discovery poll, callback scheduling and rendering add overhead; it is an observed browser startup time, not an exact server-rendering time. The [browser API documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement/requestVideoFrameCallback) explains the callback's timing and limitations.

## Hold the workload steady

- Record date, client region, connection type, browser/device, SDK version, avatar, voice and pipeline mode.
- Use the same short prompt and utterance script. Separate text-driven trials from microphone trials.
- Declare the warm-up policy in advance. Report the first attempt separately; do not assume it proves a cold backend.
- Record queue state and failures. Run sequential calls first, then a separate concurrency test within your plan and budget.
- End every call and compare recorded usage with the intended test duration.

Start with five sequential attempts to check the harness. For a first distribution, collect at least 30 attempts per condition and disclose the sample count. This is a starting protocol, not a guarantee of statistical precision: a p95 from a small sample is unstable, and stronger conclusions require more data across time and environments.

## Measure speech separately

The starter's text input bypasses spoken input and cannot establish end-of-utterance latency. For that test, use a fixed audio fixture or a controlled spoken script and capture input and output on a shared audio timeline. Mark the last input sample and first reply sample using a declared detection threshold, then inspect the waveform manually to reject noise triggers.

Keep transcription-final, first-token and audio-track-subscribed events as diagnostics. None necessarily equals the instant the user heard the reply. For interruption tests, record both time until playback stops and whether the subsequent answer incorporates the correction.

## Report failures beside the percentiles

Publish attempts, successful observations, missing observations, timeouts, queue frequency and end reasons. Calculate median and p95 on the observed successful measurements, state that denominator, and keep the failure rate alongside them. Never delete a slow queued attempt merely because it makes the result look worse.

The archive includes `scripts/summarize-startup.mjs`: run `node scripts/summarize-startup.mjs runs/*.json` on the downloaded files. It reports observed and missing counts, end reasons, median and nearest-rank p95. Keep each browser/network condition in its own folder; the script cannot infer conditions you did not record.

## What evidence supports a product decision?

A useful report links the runnable code, configuration, raw observations and calculation method. It also states what was not measured. Startup tests do not establish lip-sync quality, learning outcomes or sustained production capacity. Pair the timings with a [task-specific conversation rubric](https://realtimeavatar.ai/blog/build-a-realtime-avatar-language-practice-app-nextjs) and a [cost estimate](https://realtimeavatar.ai/tools/avatar-cost-calculator) before deciding which integration fits your app.

---

Realtime Avatar — realtime AI avatar API & SDK. Site: https://realtimeavatar.ai · Docs: https://realtimeavatar.ai/docs · OpenAPI: https://realtimeavatar.ai/openapi.json · Agent guide: https://realtimeavatar.ai/llms.txt
