# Stage 10B: diagnostic bridge overhead

Date: 2026-08-02.

## Scope

This check answers one narrow question: does the automatic diagnostic bridge
slow down regular command execution while DevTools is disconnected?

Two identical copies of the core package were compared:

- baseline — `usecase_forge` before the bridge was added;
- candidate — the Stage 10B core with the bridge, but with no Extension stream
  listener.

Both copies used the same benchmark harness and computer. The computer was
connected to AC power with Low Power Mode disabled. The full profile contained
ten measurements. The candidate was measured first, immediately followed by
the baseline. The process was repeated in JIT and AOT modes.

## Results

Each number is the median number of nanoseconds per command. Lower is better.

| Mode | Scenario | Baseline | Candidate | Difference |
|---|---|---:|---:|---:|
| JIT | one command and one state | 2760.17 | 2756.35 | -0.14% |
| JIT | 10,000 sequential updates | 2745.39 | 2765.11 | +0.72% |
| JIT | 100,000 sequential updates | 2770.92 | 2765.35 | -0.20% |
| AOT | one command and one state | 2785.79 | 2765.90 | -0.71% |
| AOT | 10,000 sequential updates | 2792.92 | 2767.87 | -0.90% |
| AOT | 100,000 sequential updates | 2777.51 | 2781.45 | +0.14% |

The largest measured regression was 0.72%, below the accepted 3% threshold.
The remaining changes point in both directions and do not show a persistent
slowdown.

## Why the disconnected bridge has little overhead

The bridge is registered automatically, but it does not start building live
event payloads until the DevTools tab completes its handshake. The Extension
stream must have a listener, and the tab must request either protocol
information or a baseline snapshot. After the tab disconnects, the next
diagnostic event detects that there is no listener and disables live mode
again.

The bridge is disabled at compile time in product VM builds and web builds.

## Raw files

- `results/runs/2026-08-02-stage10b-devtools-baseline-hot-jit.json` and `.csv`;
- `results/runs/2026-08-02-stage10b-devtools-candidate-hot-jit.json` and `.csv`;
- `results/runs/2026-08-02-stage10b-devtools-baseline-hot-aot.json` and `.csv`;
- `results/runs/2026-08-02-stage10b-devtools-candidate-hot-aot.json` and `.csv`.

They record the SDK and package versions, sample count, individual
measurements, and power mode. This comparison covers only the case where
DevTools is disconnected. An active UI and serialization of opt-in data add
diagnostic work and are not presented as free.
