[Router] [Docs] Refresh policy-selection notes (#28321)

Signed-off-by: JiangJiaWei1103 <waynechuang97@gmail.com>
This commit is contained in:
Jia-Wei Jiang
2026-06-16 17:07:19 -07:00
committed by GitHub
parent 2ad00faae1
commit ca84d52b78
+6 -5
View File
@@ -62,12 +62,13 @@ latency p50 ≤ 1.10× SMG` acceptance criterion targets.
| Policy | n=4 workers | n=16 | n=64 | n=256 | SMG equivalent | | Policy | n=4 workers | n=16 | n=64 | n=256 | SMG equivalent |
|---|---|---|---|---|---| |---|---|---|---|---|---|
| `round_robin` | 2.5 ns | 2.5 ns | 2.5 ns | 2.5 ns | SMG round-robin is O(1) — same shape. | | `round_robin` | 2.5 ns | 2.5 ns | 2.5 ns | 2.5 ns | SMG round-robin is O(1) — same shape. |
| `random` | 16 ns | 36 ns | 137 ns | 471 ns | SMG random is also O(1) per `rand::random()` call; sgl-router's variant grows with n because it `Vec::iter().nth(idx)`. **Action item:** drop sgl-router to O(1) by indexing the slice directly. | | `random` | — | — | — | — | `SliceRandom::choose` call — O(1), matching SMG's O(1) `rand::random()` call. |
| `power_of_two` | … | … | … | 1.75 µs at n=256 | SMG power-of-two-choices is identical in shape (2× rand + 2× load read). | | `power_of_two` | — | — | — | — | Two distinct indices sampled directly - O(1), matching SMG's shape (2× rand + 2× load read). |
The `random` finding (linear in worker count) is a real follow-up — file Both `random` and `power_of_two` are now O(1), ensuring consistent
an issue and pair it with a Criterion regression-guard in the same performance regardless of worker count.
bench. TODO: Add a regression guard for the O(n) shape. Although `policy_select`
measures the metric, nothing currently runs or gates on these results.
## Pre-deprecation calibration runbook ## Pre-deprecation calibration runbook