Commit 9ef0eff
Cache RefResolver subschemas lookup per instance (#4590)
_get_subschemas_cache() re-ran a full breadth-first walk of the entire
schema document (_search_schema) on every resolve() call, despite its
name. The referrer schema is immutable for a resolver instance, so
memoize the result. Removes the top self-time hotspot on large templates.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 928bbff commit 9ef0eff
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
296 | 297 | | |
297 | 298 | | |
298 | 299 | | |
| 300 | + | |
| 301 | + | |
299 | 302 | | |
300 | 303 | | |
301 | 304 | | |
302 | 305 | | |
303 | 306 | | |
304 | 307 | | |
| 308 | + | |
305 | 309 | | |
306 | 310 | | |
307 | 311 | | |
| |||
0 commit comments