Open
Description
The checks behind dev/bots/analyze.dart
have expanded over time, now nearly 3K lines, and all run in serial, and on every file in the tree, often multiple times. That is, different serial steps each load every file from the filesystem, and analyze each line for string matches.
An alternative architecture could make this significantly faster:
- Local1 runs only: Only check changed files.
- Make only ~one call to find "every file in tree" (locally: every changed file in tree)
- Have checks that do line-by-line reads re-use an opened file (instead of each reading)
- Shard and run checks in parallel (either by using a worker-process model or isolates)
- Label some checks as optional, they only run on CI or if triggered manually (with a flag)
By doing all of the above, it's possible we could have a fast commit hook to catch many small issues.
Footnotes
-
The idea behind even if there is a false positive, it will still be caught on CI. ↩