-
Notifications
You must be signed in to change notification settings - Fork 116
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
Load referenced grammars lazily #106
Comments
After debugging through the code, I think we could look into making This may be problematic however as |
I think this is a nice thing to have, but consider that So far, this has been a limitation that was well understood and that impacted only markdown. In fact, I wrote a fast plist parser especially for markdown due to this and at the time the impact for loading markdown was in the 100ms-200ms range. See microsoft/vscode#8173 . IMHO, I think the markdown performance and the TS performance should be treated as two separate issues, because one was well understood and accepted since years and is caused by really needing to load a lot of other languages, and the other one was (unnecessarily) introduced via injection to TypeScript. |
Yeah I realized this is too far down in the stack to easily make async. We can fix the regression for js/ts since this is not simple. I just wanted to make sure we know that the root cause of the problem is not js/ts specific |
From microsoft/vscode#77990
Problem
When loading a grammar that references other grammars, we currently always pull in the referenced grammars eagerly. For languages like markdown that reference a large number of grammars, this can be quite expensive.
Proposed Fix
If possible, we should investigate to see if we can resolve these referenced grammars lazily instead. For example, the markdown grammar should only load the pug grammar when it actually encounters a pug fenced code block while tokenizing text
/cc @alexandrudima
The text was updated successfully, but these errors were encountered: