Skip to content

perf: do not wait for a check the build carries nothing of - #333

Merged
alexander-akait merged 1 commit into
mainfrom
perf/do-not-wait-for-an-advisory-check
Sep 13, 2026
Merged

alexander-akait merged 1 commit into
mainfrom
perf/do-not-wait-for-an-advisory-check

Conversation

@alexander-akait

Copy link
Copy Markdown
Member

Summary

A check whose reportAs leaves both its errors and its warnings off the compilation, and that writes no outputReport, has nothing a build can wait for — it only holds the rebuild up. In watch mode such a check is now run after the rebuild rather than beside it, and what it finds is printed through the infrastructure logger.

The first build still waits: it is what tells the watcher which files the check reads (#330). From the rebuild on, the files of the last report are handed over instead. A report a newer compilation has overtaken is dropped, and a run waits for the previous one of the same check, so a tool that holds state between runs — the TypeScript program of #332 — never has two of them in it.

Measured on a 300-file project, one file changed, with an idle gap between edits (median of 5 rebuilds; no plugin = 42 ms):

check before after
typescript 257 ms 46 ms
oxlint 124 ms 45 ms
eslint 53 ms 52 ms

The work is moved out of the rebuild, not off the machine: an edit arriving while such a check is still running waits for the rest of it (typescript: 226 → 266 ms when the next edit lands in the same millisecond the previous build ended). ESLint's tail here is a single file, which is why it does not move.

Refs #332.

What kind of change does this PR introduce?

perf

Did you add tests for your changes?

Yes — test/advisory.test.js: the rebuild finishes with the check still running, a check the build does carry still holds it, the files only the check reads stay watched, a failure of a check and of its report reach the terminal, and a report a newer rebuild overtook is dropped.

Does this PR introduce a breaking change?

No. A reportAs: "log" check reaches stats.logging on a one-shot build and on the first watch build as before; from the rebuild on its output goes to the infrastructure log.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Documented in README.md under reportAs.

Use of AI

Claude Code wrote the change, the tests and this description, and ran the benchmarks above; I reviewed all of it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy


Generated by Claude Code

A check whose `reportAs` leaves both its errors and its warnings off the
compilation, and that writes no `outputReport`, has nothing for the build
to wait for. In watch mode such a check is now run once the rebuild is
over rather than beside it, and what it finds goes to the terminal
through the infrastructure logger.

The first build still waits, since it is what tells the watcher which
files the check reads; from the rebuild on, the files of the last report
are handed over instead. A report a newer compilation has overtaken is
dropped, and a run waits for the last one of the same check, so a tool
holding state between runs never has two of them in it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
@alexander-akait
alexander-akait merged commit e21d97f into main Sep 13, 2026
13 checks passed
@alexander-akait
alexander-akait deleted the perf/do-not-wait-for-an-advisory-check branch September 13, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant