Skip to content

Use lazy map for diagnostic keyToMessage, speeding up go build - #64402

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:better-diag-key-lookup
Sep 23, 2026
Merged

Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:better-diag-key-lookup

Conversation

@jakebailey

Copy link
Copy Markdown
Member

This saves something like 3 seconds of build time, and a small amount of code and startup time due to them being pushed later when needed.

Copilot AI balanced review requested due to automatic review settings September 23, 2026 00:03
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 23, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

All reviewed changes are acceptable, with no unresolved issues.

Review effort: Balanced
Findings: None

What changed in this PR

Defers diagnostic key-map construction until needed, reducing Go build and startup time.

Changes:

  • Generates a static diagnostic message pointer table.
  • Lazily initializes the key-to-message map with sync.OnceValue.
File Description
tsc/​internal/​diagnostics/​generate.go Generates the diagnostic message pointer table.
tsc/​internal/​diagnostics/​diagnostics.go Adds lazy, once-only key lookup initialization.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Sep 23, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Sep 23, 2026
Merged via the queue into microsoft:main with commit 5284367 Sep 23, 2026
29 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the better-diag-key-lookup branch September 23, 2026 00:48
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Sep 23, 2026
@jakebailey Jake Bailey (jakebailey) added the Domain: Performance Performance related label Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team Domain: Performance Performance related For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

3 participants