Repository navigation
Commit c684744
committed
Keep hot node accessors within the inlining budget
On main, Node.Symbol, Locals, Body, Expression and similar accessors
are small enough to inline, so the checker reads a member with a few
loads. Here they were all out of line: reading a member took a kind
table lookup, a ref decode and a store lookup, and several also built
a panic message inline, which the inliner charges as a call.
Symbol, Locals and Body now use the same offset tables as Name and
Expression; the JSDoc tags whose Type is their type expression, and the
kinds that never had a Body, are expressed as overrides of the tables.
Side tables keep their zero value in their first slot so that reading
one needs no test, deref finds the store without the chunk helpers,
and panics carry the kind and build their message only when printed.
Wall-clock runs were too noisy to separate the change; single-threaded
runs with the collector off measure it:
│ old.txt │ new.txt │
│ insns │ insns vs base │
VSCode 114.9G ± ∞ ¹ 113.7G ± ∞ ¹ -1.11% (p=0.008 n=5)
¹ need >= 6 samples for confidence interval at level 0.95
│ old.txt │ new.txt │
│ task-sec │ task-sec vs base │
VSCode 24.79 ± ∞ ¹ 24.53 ± ∞ ¹ -1.03% (p=0.008 n=5)
¹ need >= 6 samples for confidence interval at level 0.951 parent a4fca73 commit c684744
6 files changed
Lines changed: 186 additions & 50 deletions
File tree
- tools/scripts/tsc
- tsc/internal/ast
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1260 | 1260 | | |
1261 | 1261 | | |
1262 | 1262 | | |
1263 | | - | |
1264 | | - | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
1265 | 1266 | | |
1266 | 1267 | | |
1267 | 1268 | | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | 1269 | | |
1272 | | - | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
1273 | 1277 | | |
1274 | 1278 | | |
1275 | 1279 | | |
| |||
1297 | 1301 | | |
1298 | 1302 | | |
1299 | 1303 | | |
1300 | | - | |
| 1304 | + | |
1301 | 1305 | | |
1302 | 1306 | | |
1303 | | - | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
1304 | 1312 | | |
1305 | 1313 | | |
1306 | 1314 | | |
1307 | 1315 | | |
1308 | 1316 | | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
1309 | 1321 | | |
1310 | 1322 | | |
1311 | 1323 | | |
1312 | | - | |
1313 | | - | |
| 1324 | + | |
| 1325 | + | |
1314 | 1326 | | |
1315 | 1327 | | |
1316 | 1328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
225 | | - | |
| 223 | + | |
| 224 | + | |
226 | 225 | | |
227 | 226 | | |
228 | 227 | | |
| |||
236 | 235 | | |
237 | 236 | | |
238 | 237 | | |
239 | | - | |
240 | | - | |
241 | | - | |
| 238 | + | |
| 239 | + | |
242 | 240 | | |
243 | 241 | | |
244 | 242 | | |
245 | 243 | | |
246 | 244 | | |
247 | | - | |
248 | | - | |
249 | | - | |
| 245 | + | |
| 246 | + | |
250 | 247 | | |
251 | 248 | | |
252 | 249 | | |
| |||
289 | 286 | | |
290 | 287 | | |
291 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
292 | 301 | | |
293 | | - | |
| 302 | + | |
| 303 | + | |
294 | 304 | | |
295 | 305 | | |
296 | | - | |
| 306 | + | |
297 | 307 | | |
298 | 308 | | |
299 | 309 | | |
| |||
387 | 397 | | |
388 | 398 | | |
389 | 399 | | |
390 | | - | |
| 400 | + | |
| 401 | + | |
391 | 402 | | |
392 | 403 | | |
393 | | - | |
| 404 | + | |
394 | 405 | | |
395 | 406 | | |
396 | 407 | | |
| |||
518 | 529 | | |
519 | 530 | | |
520 | 531 | | |
| 532 | + | |
| 533 | + | |
521 | 534 | | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
| 535 | + | |
| 536 | + | |
531 | 537 | | |
532 | 538 | | |
533 | 539 | | |
| |||
913 | 919 | | |
914 | 920 | | |
915 | 921 | | |
916 | | - | |
| 922 | + | |
| 923 | + | |
917 | 924 | | |
918 | 925 | | |
919 | | - | |
| 926 | + | |
920 | 927 | | |
921 | 928 | | |
922 | 929 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
267 | 267 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
84 | 93 | | |
85 | 94 | | |
86 | 95 | | |
| |||
133 | 142 | | |
134 | 143 | | |
135 | 144 | | |
136 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
137 | 148 | | |
138 | 149 | | |
139 | 150 | | |
140 | 151 | | |
141 | 152 | | |
142 | | - | |
| 153 | + | |
143 | 154 | | |
144 | 155 | | |
145 | 156 | | |
| |||
355 | 366 | | |
356 | 367 | | |
357 | 368 | | |
358 | | - | |
359 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
360 | 372 | | |
361 | 373 | | |
362 | 374 | | |
| |||
365 | 377 | | |
366 | 378 | | |
367 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
368 | 384 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
| 385 | + | |
374 | 386 | | |
375 | 387 | | |
376 | 388 | | |
377 | 389 | | |
378 | 390 | | |
379 | | - | |
| 391 | + | |
380 | 392 | | |
381 | 393 | | |
382 | 394 | | |
383 | | - | |
384 | 395 | | |
| 396 | + | |
385 | 397 | | |
386 | 398 | | |
387 | 399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
0 commit comments