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

Sorting word suggestions causes 500ms stalls #46930

Closed
alexdima opened this issue Mar 29, 2018 · 2 comments
Closed

Sorting word suggestions causes 500ms stalls #46930

alexdima opened this issue Mar 29, 2018 · 2 comments
Assignees
Labels
freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues suggest IntelliSense, Auto Complete verified Verification succeeded
Milestone

Comments

@alexdima
Copy link
Member

  1. Create a file called new.txt
  2. In a different software, open the attached file and select all and copy:
    large.txt.zip
  3. In VSCode, paste in the new.txt file
  4. In VSCode, start typing.

Observe stalls caused by sorting word suggestions:
image

CPU-20180329T130255.cpuprofile.zip

I wonder if we could sort the suggestions on the web worker side or perhaps limit them.

@alexdima alexdima added the freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues label Mar 29, 2018
@jrieken
Copy link
Member

jrieken commented Mar 29, 2018

I wonder if we could sort the suggestions on the web worker side or perhaps limit them.

Well, they potentially come from different sources which make this complex... I could cheat and not sort them when there is only one provider... And yeah, we can simply cap the number of suggestions computed by the word suggestion logic

@jrieken jrieken added the suggest IntelliSense, Auto Complete label Mar 29, 2018
@jrieken jrieken added this to the April 2018 milestone Mar 29, 2018
@jrieken
Copy link
Member

jrieken commented Mar 29, 2018

Apart from capping the ~60000 suggestions we could be smarter with sorting. Today, we use strings#compareIgnoreCase but later, when filtering we lower-case all strings anyways... We could do that upfront and use the operator-based compare.

jrieken added a commit that referenced this issue Mar 29, 2018
@jrieken jrieken closed this as completed Apr 3, 2018
@rebornix rebornix added the verified Verification succeeded label Apr 25, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators May 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues suggest IntelliSense, Auto Complete verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants