microsoft / microsoft/TypeScript

`builder.getDeclarationDiagnostics` performance regression since 5.6

Open
#60,970 1 comment 13 reactions 1 assignee View on GitHub

@sheetalkamat is already working on this.

Since Jan 16, 2025.

Needs Investigation
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

🔎 Search Terms

Starting with version 5.6, the builder.getDeclarationDiagnostics method has become slower when invoked to retrieve diagnostics for a single SourceFile.

Here are the timing comparisons:

TypeScript Version: 5.5.2

  • builder.getDeclarationDiagnostics(): 2.247s
  • builder.getDeclarationDiagnostics(builder.getSourceFiles()[0]): 0.19ms
  • builder.getSourceFiles().forEach(sf => builder.getDeclarationDiagnostics(sf)): 1.655s

TypeScript Version: 5.7.2

  • builder.getDeclarationDiagnostics(): 1.675s
  • builder.getDeclarationDiagnostics(builder.getSourceFiles()[0]): 1.791s
  • builder.getSourceFiles().forEach(sf => builder.getDeclarationDiagnostics(sf)): 2.824s
🕗 Version & Regression Information
💻 Code

https://github.com/alan-agius4/ts-getDeclarationDiagnostics

🙁 Actual behavior

Regression in performance

🙂 Expected behavior

Similar performance

Additional information about the issue

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.