Skip to content

perf(linter): use batch API for semantic diagnostics#844

Merged
graphite-app[bot] merged 1 commit into
mainfrom
c/03-27-perf_linter_use_batch_api_for_semantic_diagnostics
Mar 27, 2026
Merged

perf(linter): use batch API for semantic diagnostics#844
graphite-app[bot] merged 1 commit into
mainfrom
c/03-27-perf_linter_use_batch_api_for_semantic_diagnostics

Conversation

@camc314

@camc314 camc314 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Before/after

Screenshot 2026-03-27 at 19.36.37.png

Related to #843

camc314 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor Author

How to use the Graphite Merge Queue

Add the label 0-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@camc314 camc314 marked this pull request as ready for review March 27, 2026 19:37
Copilot AI review requested due to automatic review settings March 27, 2026 19:37
@camc314 camc314 self-assigned this Mar 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes type-checking performance in the linter by switching semantic diagnostic collection from per-file calls to a single batched call, aligning with the performance goals in issue #843.

Changes:

  • Split syntactic vs semantic type error reporting into separate paths.
  • Fetch semantic diagnostics in bulk, then apply per-file no-emit filtering, include-processor diagnostics, and sort/dedup before emitting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/linter/linter.go
Comment thread internal/linter/linter.go
@camc314 camc314 force-pushed the c/03-27-perf_linter_use_batch_api_for_semantic_diagnostics branch from ea433d3 to aa3dcc5 Compare March 27, 2026 19:45
@camc314 camc314 requested a review from Copilot March 27, 2026 19:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@camc314 camc314 force-pushed the c/03-27-perf_linter_use_batch_api_for_semantic_diagnostics branch from 12228bb to d0578d1 Compare March 27, 2026 20:03
@camc314 camc314 requested a review from Copilot March 27, 2026 20:03

camc314 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread e2e/snapshot.test.ts
Comment on lines +702 to +709
it('should report syntactic issues', async () => {
const testFiles = await getTestFiles('semantic-syntactic-diagnostics');
expect(testFiles.length).toBeGreaterThan(0);

const config = generateConfig(testFiles, ALL_RULES, {
reportSemantic: true,
reportSyntactic: true,
});

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

This test enables both reportSemantic and reportSyntactic and the fixture contains both a syntactic error (a.ts) and a semantic type error (b.mts), but the test name says only “syntactic issues”. Consider renaming the test to reflect that it asserts both diagnostic kinds to avoid confusion when diagnosing failures.

Copilot uses AI. Check for mistakes.
@graphite-app graphite-app Bot force-pushed the c/03-27-perf_linter_use_batch_api_for_semantic_diagnostics branch from d0578d1 to 803b9de Compare March 27, 2026 20:10
@graphite-app graphite-app Bot merged commit 803b9de into main Mar 27, 2026
8 checks passed
@graphite-app graphite-app Bot deleted the c/03-27-perf_linter_use_batch_api_for_semantic_diagnostics branch March 27, 2026 20:18
@graphite-app graphite-app Bot removed the 0-merge label Mar 27, 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.

2 participants