Skip to content

W3: plan steps seen sooner, RequiredBy in parallel, pooled tick buffer - #26

Merged
donislawdev merged 3 commits into
mainfrom
perf/w3-engine-reads
Sep 28, 2026
Merged

donislawdev merged 3 commits into
mainfrom
perf/w3-engine-reads

Conversation

@donislawdev

Copy link
Copy Markdown
Owner

W3 of the performance series that followed the external report (S-6, S-5 and the narrow part of S-3).

Plan steps are seen sooner (S-6)

The pause between two looks at an entry now doubles from 10 ms up to the 250 ms cadence, instead of a flat 250 ms. The first look still goes straight after the request.

Measured on a throwaway Windows Server 2025 machine, elevated, 8 processors, five warm cycles:

operation real time, ms bws step before, ms bws step after, ms
Spooler stop 1.4-4.1 4-5 4-5
Spooler start 42.9-67.5 284-289 47-68
W32Time stop 6.3-19.4 260-272 17-25
W32Time start 34.5-41.6 277-289 44-71

An entry's wait hint is rounded up to a whole cadence before it becomes a deadline. That is where the flat cadence left it in effect, so a service that promised 50 ms and arrived at 240 ms without raising its check point is still reported as done rather than as timed out. Looking sooner never turns into giving up sooner.

Visible in the JSON of a plan: the milliseconds of each step get smaller. The shape does not change.

Not done, with the reason: holding the manager handle in WindowsScmControl. One status reading costs 0.19-0.23 ms, measured unelevated, so the saving is below the sleep granularity of Windows.

RequiredBy asks several entries at once (S-5)

Parallel.For around the existing ReadDependents, each call with its own manager handle (a shared handle measured slower), order held by index. Over 797 entries on 16 processors, unelevated: 155-167 ms one at a time, 19-40 ms after, every answer identical to the sequential one. ConcurrencyGuards carries the file with its reason.

The status tick rents its buffer (S-3, narrow part)

The enumeration block comes from ArrayPool, cut to the size the manager asked for and cleared, and ManagerBlocks.ReadEnumerationBuffer takes a span, so the reader sees the same length and the same zeros as with a new array. Over 1500 ticks: 347 KB allocated per tick became 217 KB, full collections went from 34 to 1, tick time unchanged. The rest of the report's S-3 proposal (a kept buffer with one call, a status walker without display names, a delta) is not done, for reasons in the analysis.

Guards

  • PlanRunCadenceTests: arrival noticed soon (six arrival times), short promises get the patience they always had, a long wait asks the manager about every 250 ms.
  • PlanRunnerTests: the three waiting tests assert ranges instead of multiples of 250 ms.
  • RequiredByPassParallelTests: 400 entries keep their own answers in order against a single-threaded run, and the first two questions really go out together.
  • Mutation entries: 8 new, 3 re-anchored or moved, 11 of 11 caught.
  • Narrow runs: core classes touched 94/94 and 22/22, integration runs=anywhere 24/24, window ColumnFamilyGuards 2/2, architecture 182/182. No full suite.

🤖 Generated with Claude Code

…tick buffer

Plan steps (S-6 of the external performance report): the pause between two
looks at an entry now doubles from 10 ms up to the 250 ms cadence instead of
being a flat 250 ms. On a throwaway machine the same stops and starts went
from 260-289 ms per step to 4-71 ms. An entry's wait hint is rounded up to a
whole cadence, which is where the flat cadence left it in effect, so looking
sooner never turns into giving up sooner. The waiting half of PlanRunner moved
to PlanRunner.Waiting.cs. The JSON of a plan keeps its shape, and the
milliseconds of each step get smaller.

RequiredByPass (S-5): Parallel.For around the existing ReadDependents, each
call with its own manager handle, order held by index. 155-167 ms became
19-40 ms over 797 entries on sixteen processors.

Status tick (S-3): the enumeration block comes from ArrayPool, cut to the
size the manager asked for and cleared, and the reader takes a span. 347 KB
became 217 KB allocated per tick, and full collections over 1500 ticks went
from 34 to 1.

Cost prose that quoted the sequential RequiredBy numbers is brought up to date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 6642b577-6239-4025-b163-5f0aff8fb26a


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

donislawdev and others added 2 commits September 29, 2026 00:37
The test that proves the pass really asks several entries at once needs the
thread pool to hand it a second thread. On the build agent, with the rest of
the core tests running beside it, that thread never came within ten seconds
and the test failed although the pass was parallel. The class now runs in a
collection with parallelization disabled, the same answer ReadAllContractTests
gave to the same problem, and the wait is twenty seconds, which only counts
when the test fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The header said whether the pass still earns its own family was an open question. It was answered the same day: it stays asked for, and the listing, the JSON of list and the snapshot keep their shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@donislawdev
donislawdev merged commit bb5fe5e into main Sep 28, 2026
8 checks passed
@donislawdev
donislawdev deleted the perf/w3-engine-reads branch September 28, 2026 22:45
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