Skip to content

perf: plugin gate install — children index for the in-memory store; SLOW_DISPATCH at a real 500 ms - #4169

Merged
rbuergi merged 3 commits into
mainfrom
perf/gate-install-speed
Sep 13, 2026
Merged

rbuergi merged 3 commits into
mainfrom
perf/gate-install-speed

Conversation

@rbuergi

@rbuergi rbuergi commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Where the gate's time goes (measured 2026-09-13, Plugins run 34731952463, Gate shard 1/1, 26 min)

phase time
pull + extract both images 1.4 min
bake (compile /repo, 1,100 nodes / 63 packages, no mesh) 1.3 min
install the 63 packages into the disposable mesh 18.3 min
compile + render + tests of 93 NodeTypes 3.6 min

A dotnet-trace (EventPipe sampling) of one package locally (Hosting, 198 nodes) puts 12.5 % of the samples in InMemoryStorageAdapter.ListChildPaths — a full scan of every key of the store per call, called once per directory level of every subtree query the installer issues per package: quadratic in the mesh, and the part that scaled 4× from a laptop to a 2-vCPU runner. Fix: a children index (directory → immediate child nodes + implied directories), maintained by every write path, keyed by the dictionary instance (shared stores share one index), rebuilt once if a test seeds the dictionary directly. Pinned by InMemoryStorageAdapterChildIndexTest; the 37 Hosting tests touching the adapter and subtree queries pass.

Second finding: SlowDispatchTicks = TimeSpan.TicksPerMillisecond * 500 (100-ns ticks) is compared against Stopwatch.GetTimestamp() deltas — on Linux that is 5 ms, so every dispatch over 5 ms logged MESSAGE_FLOW: SLOW_DISPATCH at Information: 366 lines per package install, 16,000 per shard (the gate raises MeshWeaver.Messaging.MessageHub to Information for QUIESCE attribution). Now Stopwatch.Frequency / 2 — the 500 ms the comment always described, on every platform. Production instances stop emitting that flood too.

Second commit — no ramp-up/down for foreign-typed roots. The installer did the placeholder → retype → root-recycle dance for EVERY non-static root; it is only needed when the root's NodeType is defined in the package itself. Every Store/Plugin satellite (nearly all of Plugins) now writes its root with its final type once and recycles nothing — which is where the ADVANCE_WITHOUT_HANDOFF bound=5000ms batches (13 s per package with NodeTypes) came from. Graph install/placeholder/retype tests (19) green.

Still next, measured: the sequential prebuilt-assembly adoption (1.5 s per type on CI). Note for readers of red gates meanwhile: on ubuntu-latest an UNSHARDED gate is cut at the 30-min cap by install time alone (Plugins#1764 run 34747207818); the 4-shard gate (#1771) and this PR are the fix, not the cap.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DqTDZe4Skkn81GuGkwMrXS

…emory store, and SLOW_DISPATCH at a real 500 ms

Measured 2026-09-13 on Plugins run 34731952463 (Gate shard 1/1, 26 min): 1.3 min bake, 18.3 min
INSTALLING 63 packages into the disposable mesh, 3.6 min compile+render+tests. A dotnet-trace of one
package locally (Hosting, 198 nodes): 12.5 % of samples in InMemoryStorageAdapter.ListChildPaths —
a full scan of every key per call, one call per directory level of every subtree query the
installer issues per package, so quadratic in the mesh; and the log flood: SlowDispatchTicks was
100-ns ticks compared against Stopwatch ticks, i.e. 5 ms on Linux — 16,000 SLOW_DISPATCH lines per
shard at Information (366 per package). The index maps a directory to its immediate children,
keyed by the dictionary instance so adapters sharing one store share one index; pinned by
InMemoryStorageAdapterChildIndexTest. The threshold is now Stopwatch.Frequency / 2.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqTDZe4Skkn81GuGkwMrXS
Copilot AI lite review requested due to automatic review settings September 13, 2026 09:25
@rbuergi
rbuergi enabled auto-merge September 13, 2026 09:25
…ped by ANOTHER package

The dance exists for a root whose NodeType is defined in the package being installed; every
non-static root took it. On the plugin gate that is every Store/Plugin satellite (Hosting,
Signature, Essentials, …): one placeholder write, one retype, one hub recycle per package, and
behind the recycle a batch of [UpdateQueue] ADVANCE_WITHOUT_HANDOFF bound=5000ms waits on the
package's compile-state writes — 13 s per package with NodeTypes (Plugins run 34731952463).
Maintainer, 2026-09-13: "must be done on running mesh not ramp up and down". Graph tests (19
install/placeholder/retype cases) green.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqTDZe4Skkn81GuGkwMrXS
@github-actions

github-actions Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

262 tests  +1   262 ✅ +1   2m 19s ⏱️ -2s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit f2743c9. ± Comparison against base commit ba39c9f.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

390 tests  ±0   390 ✅ ±0   55s ⏱️ +5s
  2 suites ±0     0 💤 ±0 
  2 files   ±0     0 ❌ ±0 

Results for commit f2743c9. ± Comparison against base commit ba39c9f.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

508 tests  ±0   508 ✅ ±0   48s ⏱️ +4s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit f2743c9. ± Comparison against base commit ba39c9f.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

1 338 tests  +7   1 336 ✅ +7   3m 52s ⏱️ -9s
    3 suites ±0       2 💤 ±0 
    3 files   ±0       0 ❌ ±0 

Results for commit f2743c9. ± Comparison against base commit ba39c9f.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

2 036 tests  ±0   2 036 ✅ ±0   4m 55s ⏱️ -38s
    4 suites ±0       0 💤 ±0 
    4 files   ±0       0 ❌ ±0 

Results for commit f2743c9. ± Comparison against base commit ba39c9f.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

    6 files  ± 0      6 suites  ±0   8m 25s ⏱️ -27s
2 914 tests +14  2 722 ✅ +14  192 💤 ±0  0 ❌ ±0 
2 918 runs  +14  2 726 ✅ +14  192 💤 ±0  0 ❌ ±0 

Results for commit f2743c9. ± Comparison against base commit ba39c9f.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   17 files  ± 0     17 suites  ±0   21m 17s ⏱️ - 1m 5s
7 448 tests +22  7 254 ✅ +22  194 💤 ±0  0 ❌ ±0 
7 452 runs  +22  7 258 ✅ +22  194 💤 ±0  0 ❌ ±0 

Results for commit f2743c9. ± Comparison against base commit ba39c9f.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

2 participants