mirror of
https://github.com/morluto/rea.git
synced 2026-10-28 10:25:42 +00:00
perf(javascript): reduce retained semantic analysis allocations (#1601)
Reduce retained semantic allocations and memoize lexical scope ancestry while preserving semantic identities. Refs #1065 and #1563; the complete-directory memory failure remains open.
This commit is contained in:
1 parent
f4e437e544
commit
b28c0337fc
7 files changed
+125
-44
No files matched your search
@@ -428,4 +428,10 @@ const enclosingFunction = (
|
||||
const semanticCallSiteId = (
|
||||
node: t.CallExpression | t.OptionalCallExpression | t.NewExpression,
|
||||
): string =>
|
||||
`call:${t.isNewExpression(node) ? "construct" : "call"}:${String(node.start ?? -1)}:${String(node.end ?? -1)}`;
|
||||
// Join once so retained IDs do not keep a chain of intermediate strings.
|
||||
[
|
||||
"call",
|
||||
t.isNewExpression(node) ? "construct" : "call",
|
||||
String(node.start ?? -1),
|
||||
String(node.end ?? -1),
|
||||
].join(":");
|
||||
Reference in new issue
Block a user