# gpui: Bound benchmark frame servicing to the tasks queued at frame start \(\#62235\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/82878540b5410b288a2c92cb9ee5675533e4d807)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 82878540b5410b288a2c92cb9ee5675533e4d807

Requested commit: 82878540b5410b288a2c92cb9ee5675533e4d807

Commit: 82878540b5410b288a2c92cb9ee5675533e4d807

Tree: 7253ffb7e9efd55ebbfe1e65a17721bd1e9f3c44

Author: Anthony Eid

Committer: GitHub

## Message

```
gpui: Bound benchmark frame servicing to the tasks queued at frame start (#62235)

The renderer benchmarks drain the main queue to quiescence before each
measured frame, so a task that yields and re-queues itself (an idle
sweep, a poller) runs to completion inside a single measured frame — or
keeps the benchmark spinning forever. Real platforms don't work that
way: macOS's main-queue drain only runs the items present when the drain
starts, Linux runs one runnable per calloop idle callback, and Windows
drains under a 10ms budget before servicing paint messages — frames
always get a chance to preempt. So `run_ready_main_tasks` now only runs
the tasks that were queued when servicing began, letting self-re-queuing
work advance one batch per frame like it would under a real run loop,
and `BenchAppContext` grows a `run_until` (wrapping the dispatcher
primitive task benchmarks already use) so setup code can pump the app
until a condition holds without settling to idle first.

Release Notes:

- N/A
```

## Parents

- [c305d68c0146530787847da507e7e972e1674e1d](https://git.cafe/gitcafe/zed/commit/c305d68c0146530787847da507e7e972e1674e1d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/82878540b5410b288a2c92cb9ee5675533e4d807?format=markdown)
