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
Large amount of CompletionItems returned by CompletionItemProvider causes significant lag #18682
Comments
@Janne252 Can you be a little more precise please? What lack to you mean? I see a short time of 'Loading...' which is basically what it takes to call all providers and to build the completion model but from then on I don't see any lack when typing Please open dev tools, and run a CPU profile for the scenario that is slow for you. That should allow us to understand this bestter |
@jrieken Absolutely. Here's 2 recordings that should demonstrate the issue: Without the massive CompletionItemProvider: With the massive CompletionItemProvider: The lag is most noticeable while typing multiple short words, like passing local variables to a function call. Perhaps I'm over-exaggerating the issue a bit. Edit: Since the gifts seem to automatically play & loop, I suppose it's best to open each individual .gif in a new tab and watch it from the beginning. |
Ok, I can reproduce but not as easy as you can. Do you have the I'll see how this can be made faster on our side, basically we are still filtering the list of 6000+ items when the next character wants to be inserted. We should be faster (or cancel earlier) but on your side you could also return less suggestion if that is possible |
No, I don't have editor.quickSuggestionsDelay set. It would be great if the process can be made faster. It's a bit problematic when the public API is so ridiculously long and with standard lua, they are all exposed in the global namespace, so reducing the number of returned suggestions is not really possible. |
Yeah, I will make it faster and already found one or two things. To validate my theories, I would be helpful if you can create profile and share it with me. Do the following
Thanks |
For reference, I typed the following text and then waited for about 5 seconds before ending the recording: |
Things we should look into
|
@Janne252 So far I have the communication between the main side and the extension host a lot faster. You should feel this when suggestions are requested freshly for a new word. Also I have made small improvements in how often and how we filter. That should make a small difference when we filter down the 6000+ suggestions against the word you are just typing... The changes will be in tomorrows insiders build and I'd be happy to get some early feedback. |
@jrieken How do I know when a new insiders build is out? |
That's good. There is an update every day and you should already have some performance improvements. It would be helpful if you can do another profiler run |
@jrieken Here you go: CPU-20170125T172131.zip |
The match/score performance will be tackled in #22153 |
Closing this as scoring, sending/receiving items, and finally garbage collection spying has been improved. This has served as a great issue to tackle various issues and I hope things are better now. I will keep the sample extensions for the future and I will continue with performance work here and there. |
If a CompletionItemProvider implementation returns a large amount of CompletionItems, it causes the text editor to lag while typing. What can be done to reduce the lag?
Steps to Reproduce:
The "issue" can be reproduced with this test extension: Janne252/vscode-test-completionItemProvider (see the readme for additional steps)
Some background:
I'm working on an extension for a video game's internal scripting language. This language has a rather large API which results in a total of 6313 completionItems from various kinds of sources, which I have dumped to a single .json file for demonstration.
The text was updated successfully, but these errors were encountered: