Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS-372 Introduce caches to improve SonarLint performance #4874

Merged
merged 39 commits into from
Oct 29, 2024
Merged

JS-372 Introduce caches to improve SonarLint performance #4874

merged 39 commits into from
Oct 29, 2024

Conversation

zglicz
Copy link
Contributor

@zglicz zglicz commented Oct 15, 2024

As part of this improvement, we include:

  1. TsConfigCache <- special cache for SonarLint runtime. It supports 2 levels of caching, of the file system traversal to detect tsconfigs and consequently a cache for a filename to tsconfig mapping. It is generous with the clearing of the cache whenever, a tsconfig is modified or a new project file (javascript or typescript) is created.
  2. Optimization of the filename to tsconfig search, by reordering pending tsconfigs to process the most likely tsconfig first.
  3. Removing superfluous calls to Path.realPath() when receiving filenames from the Typescript compiler and later when matching files to tsconfig. For SonarJS, this proved important to reduce querying all tsconfigs (195 configs) found in SonarJS from 20s to 3s.

@zglicz zglicz requested a review from vdiez October 15, 2024 15:18
@vdiez vdiez changed the title [Prototype] Introduce caches to improve SonarLint performance JS-372 Introduce caches to improve SonarLint performance Oct 21, 2024
@zglicz zglicz marked this pull request as ready for review October 25, 2024 11:45
Copy link
Contributor

@vdiez vdiez left a comment

Choose a reason for hiding this comment

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

LGTM! just a couple of minor things I'm having questions about

.cirrus.yml Outdated
@@ -129,8 +129,6 @@ build_task:
build_and_deploy_script:
- source cirrus-env BUILD
- node --version
- npm ci
- npm run check-format
Copy link
Contributor

Choose a reason for hiding this comment

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

why did we remove this?

@zglicz zglicz merged commit b9cbf21 into master Oct 29, 2024
16 of 17 checks passed
@zglicz zglicz deleted the cache branch October 29, 2024 12:58
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