Commit d29e271
perf(objectql): index short name to FQN so registry lookups stop scanning the whole registry (#11102)
* perf(objectql): index short name → FQN so registry lookups stop scanning the whole registry
`SchemaRegistry.resolveObjectKey` answered the short-name direction by walking
every `objectContributors` key and calling `parseFQN` on each. Reached from
seven call sites including `getObject`, so a kernel boot that registers N
objects and resolves O(N) names did O(N^2) string work — the mechanism behind a
hosted environment whose bootstrap outgrew its request waiter and became
permanently unservable with no error anywhere.
Maintain a short-name -> FQN index Map beside `objectContributors`, mutated
only through two private choke points (`openObjectEntry` / `closeObjectEntry`)
so the two containers cannot drift. Resolution is unchanged: the index array is
the scan's `matches` list with the same members in the same order, so an
ambiguous short name still resolves to the first key registered under it and
the ambiguity warning still names every match.
Refs #10945
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RfyXxZ2WPjcjhuXpiQQc3y
* test(objectql): tune the registry scaling pin to the measured populations, add changeset
Ablation on this container: healthy ratio 5.7-11.1, full-registry scan 62.5.
Threshold placed between them (30x) rather than close to either, and PASSES
raised so the small window clears timer noise.
Refs #10945
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RfyXxZ2WPjcjhuXpiQQc3y
---------
Co-authored-by: Claude <pm@objectstack.ai>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 189373b commit d29e271
3 files changed
Lines changed: 503 additions & 17 deletions
File tree
- .changeset
- packages/objectql/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments