Martin Vogel
51770de0b6
perf(ts): memoize expression-type evaluation per node
...
ts_eval_expr_type and ts_signature_for_call are mutually recursive: resolving
a call evaluates its argument expressions once per lookup path (method
dispatch + namespace fallback), and in tsc-compiled spread files the first
argument is itself the next nested Object.assign(...) call — the same subtree
re-evaluates once per enclosing level, 2^n total. The TS suite's
objectSpreadRepeatedComplexity.js (3.6 KB, 5 nodes) measured 20.4 s; with the
memo its eval cost is zero within measurement noise of a one-file control,
and the microsoft/TypeScript corpus drops 37.5 -> ~24 s warm (nodes
byte-identical, edges within the known scheduler jitter).
Expression types are position-pure within a file pass (one node = one scope
path; the per-file walk is single-threaded and deterministic), so one eval
per node is the correct semantics, not a cache trade-off. The memo is a
per-file, arena-backed, linear-probe table keyed on TSNode.id. Results
produced under a depth-cap or budget bail are never stored: both bail sites
bump a degradation counter, and a store only happens when the subtree
completed clean — a degraded UNKNOWN can therefore never shadow a later full
evaluation.
The regression guard asserts work, not wall-clock: the nested-Object.assign
shape must complete without exhausting the deterministic eval budget, read
back through a new CBM_ENABLE_TEST_SEAMS accessor pair. The seam lives in the
lsp_all unity object, so GRAMMAR_CFLAGS_TEST/TSAN now carry the seams define
(test artifacts always have seams; prod never does). Verified RED without the
memo (budget exhausted, suite 47.8 s) and green with it (3.2 s).
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com >
2026-08-17 00:16:16 +02:00
..
2026-08-17 00:16:16 +02:00
2026-07-16 18:34:23 +02:00
2026-04-01 23:22:44 +02:00
2026-03-15 19:26:12 +01:00
2026-05-30 18:26:44 +02:00
2026-03-17 22:05:57 +01:00
2026-08-15 16:09:04 +02:00
2026-08-02 22:40:01 +02:00
2026-08-15 08:57:12 +02:00
2026-05-30 17:02:06 +02:00
2026-08-02 22:40:01 +02:00
2026-05-28 13:55:48 +02:00
2026-07-18 15:52:50 +02:00
2026-06-27 17:40:48 +02:00
2026-05-29 00:34:18 +02:00
2026-06-08 22:55:23 +02:00
2026-05-28 13:55:48 +02:00
2026-05-08 23:26:32 +02:00
2026-08-16 22:10:34 +02:00
2026-08-03 00:16:12 +02:00
2026-08-16 21:50:34 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-06-01 18:28:36 +02:00
2026-06-01 18:28:36 +02:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-07 10:46:21 +01:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-07-23 18:40:22 +03:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-03-07 10:46:21 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-07 10:46:21 +01:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-03-07 10:46:21 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-07-01 20:17:11 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-07-11 19:09:43 -04:00
2026-07-11 19:09:43 -04:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-05-09 11:50:05 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-06-01 18:07:05 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-04-15 21:28:51 +02:00
2026-03-07 18:01:27 +01:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-03-05 22:39:01 +01:00
2026-04-15 21:28:51 +02:00
2026-08-01 01:29:20 +02:00
2026-08-01 01:29:20 +02:00
2026-07-11 19:09:43 -04:00
2026-07-11 19:09:43 -04:00
2026-07-18 15:52:50 +02:00
2026-06-22 19:56:46 -04:00
2026-07-09 14:09:39 -05:00
2026-04-01 23:22:44 +02:00
2026-03-15 19:26:12 +01:00
2026-07-11 19:09:43 -04:00
2026-07-11 19:09:43 -04:00
2026-07-13 05:21:54 +00:00
2026-07-13 05:21:54 +00:00
2026-07-07 11:33:56 +08:00
2026-07-07 11:33:56 +08:00
2026-08-03 15:37:33 +02:00
2026-07-03 20:16:39 +02:00
2026-03-05 22:39:01 +01:00
2026-08-06 16:06:43 +02:00
2026-08-06 16:06:43 +02:00