Repository navigation
Commit 47229ff
committed
perf(variables): O(N+V) map lookups in template resolve + header pass
Address gemini's perf findings on PR #92:
- variableBinding.applyBindingToObject: build a name→Variable map
once per call so a field with N markers resolves in O(N+V)
instead of N linear scans across the V Variables.
- zplGenerator.planTemplateHeader: build id/name/fn maps once
before the leaf walk so the per-leaf single-bind lookup +
per-marker name lookup + per-fn header emit all stay constant-
time. Cuts the worst case from O(N·V) to O(N+V).
Per-field Map rebuild inside zplParser.applyFnEmbeds (gemini's
4th finding) deferred — that path also bootstraps Variables so a
hoisted-cache invalidation strategy adds more complexity than the
inner-loop scan saves at current scale.
TemplateContentInput a11y findings (role=menuitem, keyboard nav)
deferred to a separate a11y pass alongside other Properties
components — keeping this PR scoped to the ^FE feature surface.1 parent 19c2984 commit 47229ff
2 files changed
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
191 | 193 | | |
192 | | - | |
193 | | - | |
194 | | - | |
| 194 | + | |
| 195 | + | |
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
96 | | - | |
| 104 | + | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
103 | | - | |
| 111 | + | |
104 | 112 | | |
105 | 113 | | |
106 | 114 | | |
| |||
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
117 | | - | |
| 125 | + | |
118 | 126 | | |
119 | 127 | | |
120 | 128 | | |
| |||
0 commit comments