> ## Documentation Index
> Fetch the complete documentation index at: https://modal-computer-use.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Measure and reduce trajectory latency

> Separate startup from warm work and measure the placed action-to-frame path.

## Keep one warm trajectory

Create the desktop once. Give the application Function and Sandbox the same supported region
selector. Enter one borrow. Reuse its pooled async client and authentication state for every warm
operation.

Every request still crosses authenticated Modal ingress.

## Measure lifecycle stages separately

| Stage | Boundary |
| - | - |
| Cold allocation | Sandbox request to allocation |
| Desktop startup | Allocation to desktop readiness |
| Function dispatch | Invocation to Function start |
| Borrow entry | Borrow request to ready leased client |
| Warm operation | Request start to validated result |
| Cleanup | Lease release and owned termination |

Native async provisioning protects cancellation and cleanup. Modal allocation and desktop startup
retain their normal timing.

## Use one step per model turn

`computer.step(actions)` sends the ordered action array and receives one versioned binary envelope.
The result contains the action result, immediate screenshot, and timing.

The 8 August Computer Step benchmark measured 100 interleaved pairs in one fixed topology. Step
measured 44.29 ms p50 and 52.57 ms p95. The prior two-request path measured 47.14 ms p50 and
58.22 ms p95.

## Keep observation meanings separate

| Observation | Meaning |
| - | - |
| Immediate step frame | Capture completed after action synchronization |
| First visual change | Experimental pixel change verification |
| Application readiness | Your workload-specific predicate passed |

## Compare screenshot sources carefully

MSS remains the default. X11-SHM remains opt-in because its fixed promotion campaign failed required
gates. A paired performance result requires matched fixture and campaign payloads.

Record the source, format, dimensions, capture backend, daemon timing, caller timing, failures, and
cleanup for every comparison.

## Use warm capacity deliberately

Positive Function minimums and Sandbox pools add idle cost. Browser prewarm moves browser startup
into the cold path. Measure arrival patterns and reconcile billing before enabling either capacity
mechanism.

Read the [benchmark guide](/benchmarks/run) for commands and fixed evidence rules.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.