Skip to content

Show progress during map and decompose, and add a real C# map benchmark - #135

Merged
QuintinBotes merged 4 commits into
mainfrom
goal/89-progress-bench
Nov 24, 2026
Merged

QuintinBotes merged 4 commits into
mainfrom
goal/89-progress-bench

Conversation

@QuintinBotes

@QuintinBotes QuintinBotes commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Closes #89 (partly: see "Not in this PR").

Scenario to test map

Scenario Test (tests/unit/cli/progress.test.mjs)
1 and 2: progress after 5 s, not more than every 5 s, phase and done of total progressFor: on a terminal it waits 5 s, then prints at most one line per 5 s
3: --json stdout is only JSON --progress prints the phase and counts on stderr, and --json stdout stays JSON (map and decompose)
4: not a terminal, each update is its own line, no carriage return same test, \r absent; progressFor returns null off a terminal unless forced
Default off a terminal prints nothing; --progress forces it without the flag, stderr carries no progress; --progress forces it off a terminal
5 (decompose speed) and 6 (real C# row) benchmark numbers below; row in docs/benchmarks.md

Decompose speed (FR-003, scenario 5)

Roslyn 20b549ba (public, 35,502 files), same store, Node 22.23.5, darwin arm64, one run each, shared machine:

cold map warm map decompose decompose RSS
before (origin/main) not run not run 20.1 s 1,690 MB
after (per-type edge index) 201 s / 3,782 MB 108 s / 2,809 MB 8.0 s 1,696 MB

Store 4,371 MB. #89's "decompose at most half of v0.3.3" is met on this run (0.40x). It is a single noisy run: I/O dominates the rest.

CPU profile (node --cpu-prof): the old code spends about 3.5 s of self time in graph.edges and its filter callback (the per-type scan, repeated per node). With the edge index those frames are gone; what remains is store reads (readFileSync, iterate, fromStore). So the cause is the edge scan, but it is about a sixth of the old 20 s, not all of it. The in-memory adjacency in FR-003 was already there; the scan was per type. tests/unit/decompose/edge-index.test.mjs failed before (28 scans) and passes now.

Checks

  • Focused: edge-index, graph and decompose cli tests, 145 tests, 143 pass, 2 skipped.
  • Full npm test: 3629 tests, 3619 pass, 1 fail (the known requireHumanTTY), 9 skipped.
  • Also fixed: the merge commit had committed conflict markers in CHANGELOG.md.

Not in this PR

  • FR-004 asks for 20k or more files: Roslyn (35,502 files) is now pinned in scripts/corpus.json and benchmarked.

🤖 Generated with Claude Code

QuintinBotes and others added 4 commits November 23, 2026 23:27
map and decompose print phase, done of total and elapsed seconds on stderr, after 5 s and at most every 5 s, on a terminal or with --progress. stdout is unchanged. scripts/bench-map.mjs maps a pinned public C# repository cold and warm and records wall time, peak RSS and file counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
decompose spent most of its CPU scanning every edge for each node and type.
The graph, the artifact model and the consistency check now share a per-type
edge index. On Roslyn (35,502 files) a decompose dry run goes from 20.1 s to
8.0 s on the same store. Pins Roslyn in the corpus and times decompose in
scripts/bench-map.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps both imports in runtime/cli/commands/map.mjs: historyNotice from
#124 and progressFor from this PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@QuintinBotes
QuintinBotes merged commit 8ef676c into main Nov 24, 2026
12 checks passed
@QuintinBotes
QuintinBotes deleted the goal/89-progress-bench branch November 24, 2026 08:54
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.

Show progress during map and decompose, and benchmark a real C# monolith

1 participant