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
MyCompletionItem is expensive #95324
Comments
related to #95325 |
Now that microsoft/TypeScript#29270 is fixed, I believe I can just disable this branch for TS 3.9+ |
For #95324 - Removes repeated calls to `getWordRangeAtPosition` - Only use our fuzzy string logic when using TS 3.8 or older
For #95324 - Get word range before we make the TS request - Reuse the context
In a empty js file, I now see the TS extension's completion conversion take around 25ms (down from around 50ms on my machine): @jrieken Let me know if you notice any other obvious optimization opportunities. |
Look at this: The memoize util is responsible for 15-20% of the time it takes to convert completion items. You are better off nuking that using a good old field. I also believe (measure, this used to be true is the past when I measured that) that computation is faster if you use static maps instead of switch-case-statements. So, have |
Good catch. Removing memo does improve The static map performs the same (or perhaps slightly worse) than the switch. I tested it by looping though a completion list 1000 times and converting the |
Thanks |
This is a follow-up from microsoft/TypeScript#36265 (comment)
MyCompletionItem
is taking quite some time and sums up to more than the actual completion requestAlso, it calls
getWordRangeAtPosition
after completions have arrived and therefore on a potentially different state, with different words etc. This should be all beforeThe text was updated successfully, but these errors were encountered: