Skip to content

[api-extractor] Reduce package name lookup overhead - #6004

Open
gwosti wants to merge 1 commit into
microsoft:mainfrom
gwosti:perf/api-extractor-package-name-lookup
Open

gwosti wants to merge 1 commit into
microsoft:mainfrom
gwosti:perf/api-extractor-package-name-lookup

Conversation

@gwosti

@gwosti gwosti commented Aug 31, 2026

Copy link
Copy Markdown

Summary

  • Reduce external package-name lookup filesystem work by reusing TypeScript's cached module and type-reference resolutions. This complements [api-extractor] Optimize the analysis type-check pass #5891 without depending on it.
  • Preserve existing package-name behavior with a package.json fallback and regression coverage for deep imports, @types, and symlinks.

Benchmarks

node ../api-extractor/bin/api-extractor run --local; for i in 1 2 3 4 5; do strace -qq -f -e trace=statx -o /tmp/ae-$i.strace node ../api-extractor/bin/api-extractor run --local; awk '/AT_SYMLINK_NOFOLLOW/{n++} END{print n+0}' /tmp/ae-$i.strace; done from apps/rush-mcp-server on Node 22.18.0, median of 5 runs after 1 warmup.

Metric Before After Change
AT_SYMLINK_NOFOLLOW calls 1,183 1,059 -124 (-10.48%)

Validation

  • (cd apps/api-extractor && ./node_modules/.bin/heft test --clean --test-path-pattern Extractor-package-name)
  • node common/scripts/install-run-rush.js test --to @microsoft/api-extractor --production
  • node common/scripts/install-run-rush.js test -t tag:api-extractor-tests --production

@gwosti

gwosti commented Aug 31, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

1 participant