Skip to content

refactor(linter): store source_text of already opened files for TsGoLintState#13197

Merged
graphite-app[bot] merged 1 commit intomainfrom
08-18-refactor_linter_store_source_text_of_already_opened_files_for_tsgolintstate_
Aug 18, 2025
Merged

refactor(linter): store source_text of already opened files for TsGoLintState#13197
graphite-app[bot] merged 1 commit intomainfrom
08-18-refactor_linter_store_source_text_of_already_opened_files_for_tsgolintstate_

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Aug 18, 2025

When a file has multiple tsgolint diagnostics, TsGoLintState will now cache the source text in memory, instead of accessing the file system again.

@github-actions github-actions bot added A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Aug 18, 2025
Copy link
Member Author

Sysix commented Aug 18, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 18, 2025

CodSpeed Instrumentation Performance Report

Merging #13197 will not alter performance

Comparing 08-18-refactor_linter_store_source_text_of_already_opened_files_for_tsgolintstate_ (845c6de) with main (b2d59a2)1

Summary

✅ 34 untouched benchmarks

Footnotes

  1. No successful run was found on main (845c6de) during the generation of this report, so b2d59a2 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Sysix Sysix force-pushed the 08-18-refactor_linter_store_source_text_of_already_opened_files_for_tsgolintstate_ branch from ccefeca to 67f151e Compare August 18, 2025 19:44
@Sysix Sysix changed the base branch from 08-18-refactor_linter_pass_lintoptions_to_tsgolintstate_new_ to graphite-base/13197 August 18, 2025 19:44
@Sysix Sysix force-pushed the graphite-base/13197 branch from c725169 to 4f8506e Compare August 18, 2025 19:44
@Sysix Sysix force-pushed the 08-18-refactor_linter_store_source_text_of_already_opened_files_for_tsgolintstate_ branch from 67f151e to 9ed315d Compare August 18, 2025 19:44
@Sysix Sysix changed the base branch from graphite-base/13197 to main August 18, 2025 19:45
@Sysix Sysix marked this pull request as ready for review August 18, 2025 19:48
Copilot AI review requested due to automatic review settings August 18, 2025 19:48
@Sysix Sysix requested a review from camc314 as a code owner August 18, 2025 19:48
Copy link
Contributor

Copilot AI left a comment

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 the TsGoLintState by implementing file content caching to reduce redundant filesystem operations. When multiple diagnostics exist for the same file, the source text is cached in memory rather than reading from disk repeatedly.

  • Introduces a FxHashMap<PathBuf, String> cache for storing file contents
  • Replaces direct read_to_string calls with cached lookups
  • Maintains existing error handling for file read operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Aug 18, 2025
Copy link
Contributor

camc314 commented Aug 18, 2025

Merge activity

…GoLintState` (#13197)

When a file has multiple `tsgolint` diagnostics, `TsGoLintState` will now cache the source text in memory, instead of accessing the file system again.
@graphite-app graphite-app bot force-pushed the 08-18-refactor_linter_store_source_text_of_already_opened_files_for_tsgolintstate_ branch from 9ed315d to 845c6de Compare August 18, 2025 20:11
@graphite-app graphite-app bot merged commit 845c6de into main Aug 18, 2025
24 checks passed
@graphite-app graphite-app bot deleted the 08-18-refactor_linter_store_source_text_of_already_opened_files_for_tsgolintstate_ branch August 18, 2025 20:15
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 18, 2025
This was referenced Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants