# Measuring a 500 ms wait with paired runs (/blog/paired-runs-for-a-browser-benchmark)

Lowering the wait after each browser action from Playwright's 500 ms to 100 ms cut the median paired wall time of nine scripted tasks by 36%, with the same calls. Running the two settings in alternating pairs is what made that readable on a busy laptop, and what showed the two tasks where the change could not be told apart from noise.

Published 2026-12-04 by William Monroy.

turno-browser [0.3.0](/releases/browser/0-3-0) added a `settle` key to identity.json: the wait after each action, which is Playwright's 500 ms by default. To see what lowering it does, the repository's evaluation suite ran nine browser tasks five times with the default and five times with `"settle": "100ms"`, on 2026-11-19 (UTC).

Across the nine tasks, the median paired difference was -9.9 s (-36%), with a 95% interval of -11.8 to -4.4 s. Every run of both configurations succeeded, with the same tool calls. For two tasks, `slow` and `find`, the suite could not tell the change apart from noise.

The machine was busy with other work during the run, as the [benchmarks page](/docs/benchmarks#evaluation-suite) records. This post is about how the suite still got a usable number out of it.

## What a run is [#what-a-run-is]

Each task is a fixed script of tool calls on local fixture pages: fill a sign-up form, approve a popup, click a button a cookie banner covers, wait for a slow page, read values from ten tabs, type into a field two shadow roots deep, work in iframes, answer a `confirm()` dialog, find one price in a 400-row catalog. The script is not a model, so both configurations get exactly the same calls, and a difference in time comes from the server.

Success is read from what the fixture site received, since each page posts what the user did, never from what the script believes. Every run gets its own server, Chrome and fixture site, and the clock starts after Chrome has.

## Pairs, and an order that alternates [#pairs-and-an-order-that-alternates]

With `--b`, every task runs in both configurations, back to back:

```sh
pnpm bench:browser --b settle-100 --rounds 5
```

Today the command runs the build of the checkout and ten tasks; the numbers here come from the suite at commit 6c56e3f with turno-browser 0.3.0.

The configuration that goes first changes from one round to the next:

```js title="bench/browser/lib/stats.mjs"
export function schedule(tasks, configs, rounds) {
  const out = [];
  for (let round = 0; round < rounds; round++) {
    const order = round % 2 === 0 ? configs : [...configs].reverse(); // [!code highlight]
    for (const task of tasks) for (const config of order) out.push({ round, task, config });
  }
  return out;
}
```

A warm disk cache, a slow first start or a laptop that heats up then weighs on both sides. Each run is compared with its pair from the same round, not with a pool of runs from the other side.

## What the pairs showed [#what-the-pairs-showed]

| Task | Default | `settle-100` | Difference | 95% interval | Pairs lower |
| --- | ---: | ---: | ---: | ---: | ---: |
| `form` | 1,354 ms | 542 ms | -59% | -1,012 to -699 ms | 5 of 5 |
| `popup` | 876 ms | 411 ms | -46% | -588 to -247 ms | 5 of 5 |
| `overlay` | 6,837 ms | 5,545 ms | -18% | -1,479 to -1,132 ms | 5 of 5 |
| `slow` | 3,789 ms | 3,106 ms | -13% | -940 to +3,013 ms | 4 of 5 |
| `tabs` | 9,549 ms | 6,518 ms | -31% | -5,847 to -1,938 ms | 5 of 5 |
| `shadow` | 1,205 ms | 329 ms | -73% | -1,046 to -728 ms | 5 of 5 |
| `frames` | 2,357 ms | 680 ms | -67% | -2,357 to -1,329 ms | 5 of 5 |
| `dialog` | 1,223 ms | 450 ms | -67% | -897 to -599 ms | 5 of 5 |
| `find` | 182 ms | 208 ms | +17% | -135 to +135 ms | 1 of 5 |
| all nine | 27,305 ms | 19,057 ms | -36% | -11.8 to -4.4 s | 5 of 5 |

The times are medians of five runs. The difference is the median of the paired differences, relative to the default's median. For all nine, the medians alone differ by 30%.

The saving is largest where a task is mostly actions: `shadow`, `frames` and `dialog` lost two thirds of their time or more.

Peak memory was 935 to 1,123 MiB at the median outside `tabs` in both configurations, and 1,633 and 1,729 MiB in `tabs`, with ten tabs open. In `form`, `dialog` and `find` it was higher with `settle-100` in all five pairs, by a median of 23 to 64 MiB; for the other six tasks the interval crosses zero.

<Bench title="The form task, five runs each" unit="ms" better="lower" rows={[{"label":"settle-100","note":"\"settle\": \"100ms\"","value":542,"min":442,"max":573},{"label":"default","note":"Playwright's 500 ms","value":1354,"min":1241,"max":1454,"tone":"base"}]} method="Five runs per configuration in pairs that alternate which goes first, with the median wall time as the bar and the fastest and slowest run as the whisker." env="Apple M3, 16 GB, macOS, Node 26.13, Chrome 157 headless, turno-browser 0.3.0" runs="median of 5" measured="2026-11-19" reproduce="/docs/benchmarks#evaluation-suite" caption="Filling and submitting a sign-up form. The slowest run with the shorter wait is still faster than the fastest with the default." />

`tabs` shows why the pairs matter. The default's five runs ranged from 7,449 to 13,999 ms and `settle-100`'s from 3,674 to 11,064 ms, so the two sets overlap. Pair by pair, `settle-100` was faster every time, by 1,938 to 5,847 ms. The slowest run of each configuration came from the same round, the fifth (13,999 and 11,064 ms).

## Where the suite could not tell [#where-the-suite-could-not-tell]

`slow` waits for a slow page and its late data. Four of five pairs were faster with the shorter wait, by 483 to 940 ms. The fifth was slower by 3,013 ms: in that `settle-100` run the first `browser_wait_for` took 4,805 ms, against 1,488 to 1,936 ms in the other nine runs. One slow run is enough to put the interval across zero, which is how the suite says it cannot tell.

<Bench title="The slow task, five runs each" unit="ms" better="none" rows={[{"label":"settle-100","note":"\"settle\": \"100ms\"","value":3106,"min":2946,"max":6790},{"label":"default","note":"Playwright's 500 ms","value":3789,"min":3609,"max":3886}]} method="Five runs per configuration in pairs that alternate which goes first, with the median wall time as the bar and the fastest and slowest run as the whisker." env="Apple M3, 16 GB, macOS, Node 26.13, Chrome 157 headless, turno-browser 0.3.0" runs="median of 5" measured="2026-11-19" reproduce="/docs/benchmarks#evaluation-suite" caption="The median moved, but one run with the shorter wait took 6,790 ms, 4,805 ms of it in one browser_wait_for." />

`find` has no click and no typing: a navigation and one `browser_find`. It took 182 ms at the median against 208 ms, and the paired differences ran from -135 to +135 ms. In a task that takes a fifth of a second, the suite cannot tell +17% apart from noise.

## Five pairs and a bootstrap [#five-pairs-and-a-bootstrap]

The interval is a 95% percentile bootstrap of the median of the paired differences: resample the differences with replacement 2,000 times, take the median of each sample, keep the middle 95%.

```js title="bench/browser/lib/stats.mjs"
export function bootstrapMedian(diffs, { resamples = 2000, seed = 1 } = {}) {
  const d = diffs.filter((x) => Number.isFinite(x));
  if (d.length < 5) return undefined; // [!code highlight]
  const rand = seeded(seed);
  const medians = [];
  for (let i = 0; i < resamples; i++) {
    const sample = d.map(() => d[Math.floor(rand() * d.length)]);
    medians.push(median(sample));
  }
  medians.sort((a, b) => a - b);
  return [medians[Math.floor(resamples * 0.025)], medians[Math.ceil(resamples * 0.975) - 1]];
}
```

The generator is seeded, so a report can be recomputed exactly from its raw runs. With fewer than five pairs there is no interval, and the suite ends its table with "Use --rounds 5 or more before trusting a difference."

The median of five values is always one of them, so with five pairs both ends of the interval are differences that were actually measured.

<Aside label="A coarse interval">
For every task here, the interval runs from the smallest measured difference to the largest. It says which way a change goes, not much about how far.
</Aside>

That is enough for the question the suite asks: does a change break a task, add calls, or cost time, tokens or memory.

## A finding on the side [#a-finding-on-the-side]

In `overlay`, the first click hits a button a cookie banner covers. In all ten runs that click took between 5,031 and 5,087 ms, with either setting: it waited out Playwright's action timeout before turno said which element covered the button. The next release, [0.4.0](/releases/browser/0-4-0), names the covering element when it still covers the target 300 ms after the call, instead of after the 5 second timeout.

## What this does not measure [#what-this-does-not-measure]

The tasks are scripted, so the suite measures the server's part of a task, not how a model decides. It ran once, on one machine. The tokens matched in every run but one: a `tabs` run of `settle-100` returned 6,820 tokens against 6,727 in the other nine, and the report does not say why.

Since [0.11.0](/releases/browser/0-11-0) the wait after a click, key press or typed text ends as soon as the page is done with it. Its limit is [the longest Playwright's wait can be](/docs/browser/actions#actions): `settle` when the action started no request; with requests, `settle`, up to 5 s for them and `settle` again; after a navigation, `settle`, up to 10 s and `settle` again, one `settle` longer than Playwright. Read mode and one other [engine](/docs/browser/engines) keep the fixed wait. The numbers above describe 0.3.0, where the wait was fixed.

## Sources [#sources]

Measured on an Apple M3 with 16 GB, macOS, Node 26.13 and headless Chrome 157, with turno-browser 0.3.0, from 04:25 to 04:34 UTC on 2026-11-19. The [raw runs](https://github.com/wimo-dev/turno/blob/acc16d6/bench/results/2026-11-18-m3-16gb-browser-eval-settle.json), in a file named 2026-11-18, keep every call of every run and the paired summary, and the suite came with [pull request 93](https://github.com/wimo-dev/turno/pull/93).