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

Slow to switch to/from tab with large collapsed section #32330

Closed
ghost opened this issue Aug 11, 2017 · 6 comments
Closed

Slow to switch to/from tab with large collapsed section #32330

ghost opened this issue Aug 11, 2017 · 6 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Aug 11, 2017

  • VSCode Version: Code - Insiders 1.16.0-insider (dc3a6df, 2017-08-11T07:07:15.518Z)
  • OS Version: Windows_NT x64 10.0.15063
  • Extensions: none

Steps to Reproduce:

  1. New empty directory
  2. npm install @types/lodash
  3. Create a file a.ts containing _.add(1, 2)
  4. Go to definition on _ to get taken to node_modules/@types/lodash/index.d.ts
  5. Collapse the declare namespace _ section, which spans nearly 20000 lines.
  6. Go back to the tab from a.ts, then back to index.d.ts, repeat. It's noticeably slow. No issue if you uncollapse everything.
@vscodebot vscodebot bot added the insiders label Aug 11, 2017
@bpasero bpasero assigned aeschli and unassigned bpasero Aug 11, 2017
@bpasero
Copy link
Member

bpasero commented Aug 11, 2017

I think in this case a CPU profile would help:

To create a CPU profile using developer tools in VS Code:

  • select Help > Toggle Developer Tools
  • click on Profiles
  • click the start button
  • do whatever you need to do to get the CPU spin high
  • wait for some time (10-20 seconds should be enough)
  • stop the profiling
  • click the save button and attach the output file to this issue

@ghost
Copy link
Author

ghost commented Aug 11, 2017

OK, here it is:
CPU-20170811T083908.zip

@aeschli
Copy link
Contributor

aeschli commented Aug 15, 2017

image

Trace when the the editor that shows index.d.ts gets active.
Note how the decoration are all computed in 'setModel', disposed and recomputed again in 'restoreViewState'.

@sandy081 You made these changes in de73151.
Do you remember why?

@aeschli
Copy link
Contributor

aeschli commented Aug 15, 2017

@sandy081 I changed the code of restoreViewState to no longer rebuild the folded ranges. Looks like the settings default editor no longer requires that anyway.

@aeschli aeschli added this to the August 2017 milestone Aug 15, 2017
@aeschli aeschli added the perf label Aug 15, 2017
@sandy081
Copy link
Member

@aeschli Yes that was done to restore the folding state of default settings editor which is not the case anymore.

@rodrigobutta
Copy link

Same problem here. Switching tabs and i think almost everything is having a slow response since a few days ago, My pc has an I7, 12GB RAB and SSD. Windows 10, 64.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants