Repository navigation
Commit 4bf93b6
committed
perf(bridge): share stable declaration SFs process-globally (issue #6)
The stable host SourceFile cache (bound host ASTs for bundled libs and
node_modules .d.ts) was keyed per LS host, so every configured project
materialized its own full copy of the entire declaration closure. In a
3-tsconfig probe the same ~130-file closure was fully materialized once
per project (509 full SFs), and every additional tsconfig re-paid it —
the dominant tsserver memory cost in multi-project workspaces and the
reason thousand-.vue repos were untenable.
The cache is now process-global: stable .d.ts binds identically for a
given content version and ensureHostSourceFileBound brands after a
single bind (no re-binding), so one entry serves every project, with
replacement on scriptVersion change.
Measured (8 .vue opens, 3 tsconfigs): full materializations 509 -> 139,
V8 heap 419 -> 183 MB (-56%), putting the multi-project cost on par with
single-project. Gates: sourcefile-guard, sim-edit 200, sim-xfile 71/71,
qi-emptyparity 12/12, display-tokens 6/6, computed-literal 7/7,
check:lib/enums/bundle-shape, volar 205 passed, sim-nav 37,409 units
CONSERVED (new=0).1 parent 3749fa4 commit 4bf93b6
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
446 | 454 | | |
447 | 455 | | |
448 | 456 | | |
| |||
4144 | 4152 | | |
4145 | 4153 | | |
4146 | 4154 | | |
4147 | | - | |
| 4155 | + | |
4148 | 4156 | | |
4149 | 4157 | | |
4150 | 4158 | | |
| |||
0 commit comments