Skip to content

refactor: [DSM-103] Refactor RoundSchedule#9569

Open
alin-at-dfinity wants to merge 1 commit intomasterfrom
alin/DSM-103-refactor-RoundSchedule
Open

refactor: [DSM-103] Refactor RoundSchedule#9569
alin-at-dfinity wants to merge 1 commit intomasterfrom
alin/DSM-103-refactor-RoundSchedule

Conversation

@alin-at-dfinity
Copy link
Contributor

Cleaner separation between SchedulerImpl and RoundSchedule:

  • Encapsulate accounting (tracking of fully executed canisters, executed canisters, rate limited canisters, etc.) within RoundSchedule.
  • Encapsulate immutable round configuration (cores, rate limits) inside a Config struct.
  • Define an IterationSchedule type and return that instead of a filtered RoundSchedule for scheduling during inner loop iterations.
  • Move round metrics observations (canister age, executable canisters, executed canisters) into RoundSchedule.
  • Make all scheduling step duration metric observations in scheduler.rs.
  • Update scheduler_bench to be more realistic: 00k canisters, 5k active, 1k executed every round. Aldo add a finish_round benchmark.

There should be no meaningful change in scheduler behavior from this change, it consists almost exclusively from code being moved around. There is one minor optimization (don't recompute the subnet available memory at the top of the first iteration); and one additional metric (scheduling duration as an inner loop iteration step) resulting in a mechanical change to one test case; but all other tests pass without modification.

Cleaner separation between `SchedulerImpl` and `RoundSchedule`:
* Encapsulate accounting (tracking of fully executed canisters, executed canisters, rate limited canisters, etc.) within `RoundSchedule`.
* Encapsulate immutable round configuration (cores, rate limits) inside a `Config` struct.
* Define an `IterationSchedule` type and return that instead of a filtered `RoundSchedule` for scheduling during inner loop iterations.
* Move round metrics observations (canister age, executable canisters, executed canisters) into `RoundSchedule`.
* Make all scheduling step duration metric observations in `scheduler.rs`.
* Update `scheduler_bench` to be more realistic: 00k canisters, 5k active, 1k executed every round. Aldo add a `finish_round` benchmark.

There should be no meaningful change in scheduler behavior from this change. There is one small optimization (don't recompute the subnet available memory at the top of the first iteration); and one additional metric (scheduling time as inner loop iteration step) that results in a minor change to a test case; but all other tests pass without modification.
@alin-at-dfinity alin-at-dfinity requested a review from a team as a code owner March 24, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant