Commit b5efbab
perf: Look up sandbox scheduler priorities per canister (#10279)
`evict_sandbox_processes` only needs the accumulated priority of the
canisters that have an active sandbox backend, but currently asks
`ReplicatedState` for the priorities of *all* canisters on the subnet,
materializing a fresh `BTreeMap<CanisterId, AccumulatedPriority>` on
every eviction pass.
Replace the bulk lookup with per-id `canister_state(id)` /
`canister_priority(id)` calls inside the existing `backends.iter()`
loop. Behaviour is unchanged: a missing canister still falls through to
`AccumulatedPriority::MIN`.
With the sandbox controller migrated,
`canister_accumulated_priorities()` has no remaining callers, so drop it
(and its now-unused `AccumulatedPriority` import) from
`ReplicatedState`.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 63b841f commit b5efbab
2 files changed
Lines changed: 8 additions & 26 deletions
File tree
- rs
- canister_sandbox/src/replica_controller
- replicated_state/src
Lines changed: 7 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2068 | 2068 | | |
2069 | 2069 | | |
2070 | 2070 | | |
2071 | | - | |
2072 | | - | |
2073 | | - | |
2074 | | - | |
2075 | | - | |
| 2071 | + | |
2076 | 2072 | | |
2077 | 2073 | | |
2078 | 2074 | | |
| |||
2082 | 2078 | | |
2083 | 2079 | | |
2084 | 2080 | | |
2085 | | - | |
2086 | | - | |
2087 | | - | |
2088 | | - | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
2089 | 2087 | | |
2090 | 2088 | | |
2091 | 2089 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | 689 | | |
706 | 690 | | |
707 | 691 | | |
| |||
0 commit comments