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

chore(compiler): improve performance for isolatedModules: false #1549

Closed
wants to merge 7 commits into from
Closed

chore(compiler): improve performance for isolatedModules: false #1549

wants to merge 7 commits into from

Conversation

ahnpnl
Copy link
Collaborator

@ahnpnl ahnpnl commented Apr 20, 2020

Summary

Improve performance for isolatedModules: false by only creating LanguageService instance with limited amount of initial files.

Because when creating LanguageService instance with fileNames from tsconfig, often this fileNames includes all the files in the project which makes internal TypeScript performs scanning and reading the unnecessary files. This is not optimal because it will create lots of I/O threads which then impact heavily on the performance.

This PR should help #1115 and all related performance issues by somewhere around 30% improvement in speed.

Test plan

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@ahnpnl
Copy link
Collaborator Author

ahnpnl commented Apr 20, 2020

@kulshekhar I tested with my company project and it improved almost 30% test speed. Can you please help testing this against your real repo to see if this approach causes any issues and how it improves ?

@kulshekhar
Copy link
Owner

kulshekhar commented Apr 20, 2020 via email

@ahnpnl
Copy link
Collaborator Author

ahnpnl commented Apr 20, 2020

Ye I think let’s try with a alpha/beta version and wait for feedbacks. We can use RFC issue to gather feedbacks for that unreleased version.

UPDATE: I think I found the way to fix the internal tests. I’m more curious about how this behaves for a real repo.

@coveralls
Copy link

coveralls commented Apr 20, 2020

Pull Request Test Coverage Report for Build 4495

  • 48 of 48 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 92.893%

Totals Coverage Status
Change from base Build 4493: 0.05%
Covered Lines: 1074
Relevant Lines: 1109

💛 - Coveralls

@ahnpnl
Copy link
Collaborator Author

ahnpnl commented Apr 20, 2020

ok this branch is ready for alpha/beta release. I think we shouldn't merge into master yet but wait for feedbacks and decide later.

@kulshekhar
Copy link
Owner

@ahnpnl as I suspected, my repos aren't big enough to show a noticeable difference.

I'll get to publishing an alpha version after work today

@ahnpnl
Copy link
Collaborator Author

ahnpnl commented Apr 21, 2020

made a final push before releasing alpha version. I've tested on Windows with my company project, also see a reduction around 30%, some cases even 40%

@ahnpnl
Copy link
Collaborator Author

ahnpnl commented Apr 21, 2020

actually alpha-2 is still not the correct version... I made small mistake so the latest commit e75ff6b should be the one we need to use for testing.

@ahnpnl ahnpnl closed this Apr 22, 2020
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.

3 participants