Commit 0435c41
authored
perf(native): fix WASM fallback bypass and batch SQL inserts (#606)
* chore: add benchmark npm script and stale embeddings warning
Add `npm run benchmark` script to make benchmark execution discoverable
instead of requiring manual `node --import ./scripts/ts-resolve-loader.js`
invocation.
Warn users when embeddings predate the last graph rebuild so they know
to re-run `codegraph embed` for fresh search results.
Impact: 1 functions changed, 8 affected
* perf(native): fix WASM fallback bypass and batch SQL inserts
Fix interface property signatures (dotted names, single-line spans)
incorrectly triggering WASM tree creation on native builds across
engine.ts, complexity.ts, and cfg.ts. Add statement caching and
batch UPDATE optimizations for insert and role classification stages.
Native full build: 2001ms vs WASM 3116ms (1.6x faster).
Key wins: complexity 4.2x, cfg 3.2x, parse 2.4x faster.
Impact: 26 functions changed, 25 affected
* fix(structure): remove superfluous optional chaining on hotspot query stmt (#606)
Impact: 1 functions changed, 0 affected
* fix(builder): cache export-marking UPDATE statement per chunk size (#606)
Impact: 1 functions changed, 1 affected
* fix(types): resolve TS strict-mode errors in structure.ts and complexity.ts (#606)
Impact: 3 functions changed, 2 affected
* fix: correct misleading comments and cache role UPDATE stmts (#606)
- Fix misleading "single nodeIdMap pass" comment in insertChildrenAndEdges
(actually two passes: one before and one after batchInsertNodes)
- Cache role UPDATE prepared statements per chunk size in classifyNodeRoles,
consistent with WeakMap-based caching pattern used in helpers.ts
Impact: 2 functions changed, 4 affected1 parent 820e9ff commit 0435c41
7 files changed
Lines changed: 306 additions & 231 deletions
File tree
- docs/roadmap
- src
- ast-analysis
- domain/graph/builder
- stages
- features
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
117 | 134 | | |
118 | 135 | | |
119 | 136 | | |
120 | | - | |
| 137 | + | |
121 | 138 | | |
122 | 139 | | |
123 | 140 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 141 | + | |
131 | 142 | | |
132 | 143 | | |
133 | 144 | | |
| |||
186 | 197 | | |
187 | 198 | | |
188 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
189 | 203 | | |
190 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
191 | 211 | | |
192 | 212 | | |
193 | 213 | | |
| |||
213 | 233 | | |
214 | 234 | | |
215 | 235 | | |
216 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
217 | 240 | | |
218 | 241 | | |
219 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
212 | 252 | | |
213 | 253 | | |
214 | 254 | | |
215 | 255 | | |
216 | 256 | | |
217 | 257 | | |
218 | 258 | | |
219 | | - | |
220 | 259 | | |
221 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
222 | 263 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
228 | 269 | | |
229 | 270 | | |
230 | 271 | | |
| |||
234 | 275 | | |
235 | 276 | | |
236 | 277 | | |
237 | | - | |
238 | 278 | | |
239 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
240 | 282 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
246 | 288 | | |
247 | 289 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
68 | 85 | | |
69 | 86 | | |
70 | 87 | | |
71 | 88 | | |
72 | | - | |
| 89 | + | |
73 | 90 | | |
74 | | - | |
| 91 | + | |
75 | 92 | | |
76 | 93 | | |
77 | 94 | | |
78 | 95 | | |
| 96 | + | |
| 97 | + | |
79 | 98 | | |
| 99 | + | |
80 | 100 | | |
81 | 101 | | |
82 | 102 | | |
83 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
84 | 107 | | |
85 | | - | |
86 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
87 | 116 | | |
| 117 | + | |
88 | 118 | | |
| 119 | + | |
89 | 120 | | |
90 | 121 | | |
91 | 122 | | |
| |||
101 | 132 | | |
102 | 133 | | |
103 | 134 | | |
104 | | - | |
105 | | - | |
106 | 135 | | |
107 | | - | |
| 136 | + | |
| 137 | + | |
108 | 138 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 139 | + | |
114 | 140 | | |
115 | 141 | | |
116 | 142 | | |
117 | 143 | | |
118 | 144 | | |
119 | | - | |
120 | 145 | | |
| 146 | + | |
121 | 147 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
133 | 155 | | |
134 | 156 | | |
135 | 157 | | |
136 | 158 | | |
137 | 159 | | |
| 160 | + | |
138 | 161 | | |
139 | 162 | | |
140 | 163 | | |
| |||
217 | 240 | | |
218 | 241 | | |
219 | 242 | | |
220 | | - | |
221 | | - | |
| 243 | + | |
222 | 244 | | |
223 | 245 | | |
224 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
95 | 102 | | |
96 | 103 | | |
97 | 104 | | |
| |||
206 | 213 | | |
207 | 214 | | |
208 | 215 | | |
209 | | - | |
| 216 | + | |
210 | 217 | | |
211 | 218 | | |
212 | 219 | | |
213 | 220 | | |
214 | 221 | | |
215 | 222 | | |
216 | 223 | | |
217 | | - | |
| 224 | + | |
218 | 225 | | |
219 | 226 | | |
220 | 227 | | |
| |||
0 commit comments