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

Fix for issue #85 Extension hangs / freezes VS Code in big folders #90

Merged
merged 1 commit into from
Oct 12, 2017

Conversation

egamma
Copy link
Contributor

@egamma egamma commented Oct 12, 2017

This fix makes two changes:

  • instead of parsing all files in parallel, it does it in batches by using the async.eachLimit function with a batch size of 100 (see the change in extension.ts).
  • it replaces the use of vscode.TextDocument with a cheaper implementation that reads the file directly from disk using the node fs module. I did the change minimally invasive so that the parsers are only minimally affected.

Tested the scalability of the implementation of the chromium code base. The vscode UI was staying responsive and the extension host did not crash 😄. This is the result:

[Extension Host] Summary:
[Extension Host]% 46577 parseable documents found
[Extension Host]% 55894 CSS class definitions found
[Extension Host]% 9822 unique CSS class definitions found
[Extension Host]% 681 failed attempts to parse.

@zignd
Copy link
Owner

zignd commented Oct 12, 2017

What an impressive improvement 😀, thanks for taking your time. I will test it in a moment.

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.

None yet

2 participants