Skip to content

Continue optimizing scheduler performance - #36

Merged
ReubenBond merged 7 commits into
mainfrom
reubenbond-optimize-scheduler-performance
Jul 30, 2026
Merged

Continue optimizing scheduler performance#36
ReubenBond merged 7 commits into
mainfrom
reubenbond-optimize-scheduler-performance

Conversation

@ReubenBond

Copy link
Copy Markdown
Owner

Summary

  • add scheduler scaling, allocation-slope, readiness, replay, timer, race-tracker, and decision-log benchmarks
  • pool readiness snapshots and remove per-step replay status materialization
  • optimize virtual timer advancement, race diagnostics, and decision metadata formatting
  • keep decision capture opt-in and make default round-robin selection cancellation-safe in one scan

Performance

  • no decision log: 3.01 us -> 2.80 us per dispatch; 3 B allocated
  • decision log enabled: 3.81 us and 275 B per dispatch (~36% slower, ~92x allocation)
  • 1,024 timers advanced individually: 11.39 ms / 656 KB -> 4.26 ms / 168 KB
  • 16-lock race access: 689 ns / 1,464 B -> 201 ns / 536 B
  • 256-operation replay recording: 136.15 MB -> 48.09 MB

Validation

  • 2,017 tests passed; 16 opt-in package smoke tests skipped
  • BenchmarkDotNet default runs and pvanalyze CPU/GC traces captured
  • two GPT-5.6 Sol extra-high correctness reviews completed

Add fixed-dispatch scaling, readiness fan-out, allocation-slope, and trace scenarios for the next scheduler optimization pass.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 58f51472-51b1-4cff-9ed4-e26460b5163c
Reuse arrays while polling pending readiness predicates, eliminating the per-dispatch snapshot allocation without evaluating callbacks under the scheduler lock.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 58f51472-51b1-4cff-9ed4-e26460b5163c
Benchmark record and replay scaling, then use the existing failure listener instead of materializing all operation statuses after every dispatch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 58f51472-51b1-4cff-9ed4-e26460b5163c
Benchmark timer batches and replace LINQ plus hash-set materialization with stable in-place partitioning and direct due-list sorting.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 58f51472-51b1-4cff-9ed4-e26460b5163c
Benchmark race-tracker access overhead and construct public reports plus synchronization labels only when a conflict is detected.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 58f51472-51b1-4cff-9ed4-e26460b5163c
Write candidate operation IDs directly into one exact-sized metadata string, eliminating per-candidate arrays and strings during decision logging.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 58f51472-51b1-4cff-9ed4-e26460b5163c
Keep decision capture opt-in, benchmark logged and unlogged dispatch side by side, and select default round-robin work in one cancellation-safe scan.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 58f51472-51b1-4cff-9ed4-e26460b5163c
@ReubenBond
ReubenBond merged commit 9de92f6 into main Jul 30, 2026
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