Skip to content

chore: read the type names of union-typed properties ahead in one batch - #3400

Closed
momo-bee wants to merge 2 commits into
aws:preview/v7.1from
momo-bee:perf-read-ahead-type-names
Closed

momo-bee wants to merge 2 commits into
aws:preview/v7.1from
momo-bee:perf-read-ahead-type-names

Conversation

@momo-bee

@momo-bee momo-bee commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Depends on #3399; review the last commit.

getSymbolAtLocation was the biggest group of single requests left on aws-cdk-lib (11,273). Most of them (6,690) come from _unionNodeOf, which looks up the type name of a union-typed member to find the type alias of the union.

For the properties of all exported types, these names are now read ahead in one batch with the readAhead helper. Only properties whose type, already read ahead by #3399, is a union are included, so no extra names are asked for. A first version read every type name of every member: it saved 6,500 requests, but its extra server work made the build 0.4s slower. That version was dropped. Parameters are left as they are.

  • aws-cdk-lib requests: 129,251 -> 123,843. getSymbolAtLocation: 11,273 single calls -> 5,865; server time 9.83s -> 9.61s.
  • Full jest passes on Node 26 with coverage (functions 96.77%).
  • jsii-calc and aws-cdk-lib (plain, --add-deprecation-warnings, --strip-deprecated) are byte-identical.
  • aws-cdk-lib, 4 paired runs against chore: read the property and constructor parameter types ahead in batches #3399: median 49.27s -> 49.29s (gaps -0.12, -0.02, +0.46, -0.89s): the same, with fewer requests.

@momo-bee

momo-bee commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

Closing: it saves 5,400 requests but showed no time gain (paired median 49.27s -> 49.29s).

@momo-bee momo-bee closed this Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant