You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Split out of #10757 (direction 5) by PM ruling on PR #10824, at low priority — see the calibration below.
resolveLocalizationContext issues three identicalselect * from sys_setting where namespace = ? per request (queries 16–18 of 24, measured on a live rig in PR #10824). The function already batches its own direct fallback into one $in, but the settings-service path it prefers calls SettingsService.get() three times, and each call runs loadRows(namespace, …) over the whole namespace.
Three reads of one question, inside one request. Replace them with one namespace read the three keys are picked out of.
Calibration — this is smaller than it looks
cloud#1539 measured these three reads running in parallel: 3 queries but 1 leg. Since that same work established that legs, not queries, are the latency multiplier, the win here is ~2 queries and ≈0 legs.
So this is not a latency fix, and should not be scheduled as one. It is worth doing because:
it shrinks what direction 5 would have to cache, which makes that card's invalidation design smaller and safer.
Constraints
No caching. One read instead of three, within the request. Anything surviving the request boundary is direction 5, a different card with a security review attached.
Preserve read-after-write. 新环境日志被 sys_setting 'no such table' ERROR 刷屏:本地化读取先于建表,真错误被噪音淹没 #10221 caches only failed reads deliberately, and a dogfood test pins analytics-timezone read-after-write; a single batched read within the request satisfies that, a cache would not without invalidation.
Split out of #10757 (direction 5) by PM ruling on PR #10824, at low priority — see the calibration below.
resolveLocalizationContextissues three identicalselect * from sys_setting where namespace = ?per request (queries 16–18 of 24, measured on a live rig in PR #10824). The function already batches its own direct fallback into one$in, but the settings-service path it prefers callsSettingsService.get()three times, and each call runsloadRows(namespace, …)over the whole namespace.Three reads of one question, inside one request. Replace them with one namespace read the three keys are picked out of.
Calibration — this is smaller than it looks
cloud#1539 measured these three reads running in parallel: 3 queries but 1 leg. Since that same work established that legs, not queries, are the latency multiplier, the win here is ~2 queries and ≈0 legs.
So this is not a latency fix, and should not be scheduled as one. It is worth doing because:
Constraints
packages/specis off limits.