The build scan asks each directory once
Explore this workspace.
Technical background
Opening the Builds page spent 805ms walking the search roots, almost all of it on filesystem probes answered by a directory listing it then made anyway. The listing is read first and the expensive checks run only where it says they could succeed: 27-39ms, proved to find the identical set. Built from also says which of its two commits is the checkout's current head.
The problem
Opening the Builds page took noticeably long before anything appeared, and 805ms of that was the directory walk — against 116ms for a plain walk of the same roots.
How it works
Neither cause was algorithmic. The walk asked before it looked: every directory ran the checkout test and then the application test, and the latter probes each executable name in turn, so a directory that is neither paid for the whole list before the readdir that would have answered in one call. The listing is read first now, and the expensive checks run only where it says they could succeed. The walk is also breadth-first and bounded-concurrent rather than strictly serial.
Three consecutive scans, after
walkRoots 36ms readVersions 273ms materialize 19ms walkRoots 27ms readVersions 302ms materialize 18ms walkRoots 33ms readVersions 303ms materialize 9ms
Details
- Proved equivalent rather than assumed. A longhand serial walk of the same roots, with the same predicates written out, finds the identical set — one checkout, two application directories, nothing on either side only — and takes 3358ms doing it.
- Results are gathered per input index rather than pushed as they land. The scan dedupes by root, so a non-deterministic winner would be a non-deterministic page.
- The remaining cost is reading each executable's version resource, which is now most of the scan.
- The Built from column also stops reading as a range:
abc1234 → def5678looked like a span of commits when it meant "compiled from the first, and the checkout has since moved to the second". The second is labelled, and a tooltip says it in words.
What this does not claim
- The numbers are this machine's, with four search roots and 1,433 directories under them. A tree of a different shape will differ.
- Nothing here speeds up the version reads, which now dominate.