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

Previewing large diff prevents diffing other files for about 10-20 seconds #57697

Closed
borekb opened this issue Aug 31, 2018 · 14 comments
Closed
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@borekb
Copy link

borekb commented Aug 31, 2018

  • VSCode Version: 1.26.1
  • OS Version: macOS High Sierra, Windows 10

Steps to Reproduce:

  1. Have a version-controlled project with a large file, for example, yarn.lock or package-lock.json are usually good suspects to reproduce this.
  2. Make some change in that large file, e.g., install new npm dependency.
  3. Make some other, "normal" change to some source file so that you have two changes to commit.
  4. In the VCS sidebar, click the large file (e.g., yarn.lock) – VSCode opens the diff editor.
  5. Click the other file, notice that the much smaller diff is not being opened for quite a while (can be somewhere between 10-20 seconds on my machine).

VSCode is responsive during this time but clicking files in the VCS panel does nothing, or appears to. I've been observing this issue for many versions of VSCode and finally decided to report it :)

Does this issue occur when all extensions are disabled?: Yes

@alexdima
Copy link
Member

alexdima commented Sep 3, 2018

Duplicate of #40681

@alexdima alexdima marked this as a duplicate of #40681 Sep 3, 2018
@alexdima alexdima closed this as completed Sep 3, 2018
@alexdima alexdima added the *duplicate Issue identified as a duplicate of another issue(s) label Sep 3, 2018
@alexdima alexdima reopened this Sep 14, 2018
@alexdima
Copy link
Member

@borekb Can you please give the files that reproduce or some files very similar in shape (if you cannot share the original files) ?

@borekb
Copy link
Author

borekb commented Sep 14, 2018

@alexandrudima I just found out that it's most likely caused by some extension as I can't reproduce it in Insiders. Good luck to me finding out which one it is as I have quite a few of them:

My VSCode stable extensions:

Extension Author (truncated) Version
spellright ban 2.5.32
emojisense bie 0.4.1
markdown-preview-github-styles bie 0.1.3
vscode-tailwindcss bra 0.1.11
npm-intellisense chr 1.3.0
path-intellisense chr 1.4.2
vscode-markdownlint Dav 0.20.0
githistory don 0.4.2
gitlens eam 8.5.6
remotehub eam 0.2.0
EditorConfig Edi 0.12.4
tslint eg2 1.0.39
vscode-npm-script eg2 0.3.5
LogFileHighlighter emi 2.4.1
markdown-table-formatter fcr 1.3.2
php-debug fel 1.12.5
auto-rename-tag for 0.0.15
vscode-pull-request-github Git 0.1.5
rest-client hum 0.19.1
crane Hvy 0.3.8
vscode-github Kni 0.30.0
goto-last-edit-location kri 0.2.1
git-tree-compare let 1.3.0
terraform mau 1.3.4
dotenv mik 1.0.1
vscode-docker Pet 0.2.0
code-settings-sync Sha 3.1.2
vscode-scss-formatter Sib 1.0.2
vscode-markdown-link-suggestions Tom 11.0.1
vscode-terminal-here Tyr 0.1.1
es-quotes vil 0.2.6
quokka-vscode Wal 1.0.148
wallaby-vscode Wal 1.0.93
markdown-all-in-one yzh 1.6.0

My Insiders extensions:

Extension Author (truncated) Version
markdown-preview-github-styles bie 0.1.3
vscode-markdownlint Dav 0.20.0
gitlens eam 8.5.6
EditorConfig Edi 0.12.4
code-settings-sync Sha 3.1.2
vscode-markdown-link-suggestions Tom 11.0.1
markdown-all-in-one yzh 1.6.1

@alexdima
Copy link
Member

@borekb This is pretty easy to figure out. Just run F1 > Show running extensions and press the record button. You might need to restart in order to run the extension host with debugging turned on.

Then, do the steps that reproduce for you and the extension with the most CPU time will show up. You can also save the profile if you want to and attach it here.

@borekb
Copy link
Author

borekb commented Sep 17, 2018

Thanks, I'll try that.

@alexdima alexdima added info-needed Issue requires more information from poster and removed *duplicate Issue identified as a duplicate of another issue(s) labels Sep 17, 2018
@borekb
Copy link
Author

borekb commented Sep 17, 2018

Hmm, after reproducing the behavior and running profiler at the same time, this is the result after roughly 10 seconds. I.e., "nothing":

image

VSCode is perfectly responsive at all time, I just hear CPU fan spinning faster and clicking on other files in SCM view does nothing.

Any other suggestions on where to look?

@alexdima
Copy link
Member

@borekb Can you please save the profile and attach it here. Sometimes, we have trouble automatically associating a certain stack trace to a certain extension and sometimes we need to look into the profile manually.

Also, it is possible that extensions include native node modules. In such cases, we could not associate the CPU time spent directly.

Btw, if the above list reproduces for you, you might want to look into disabling: EditorConfig (unlikely), Spell Right, emojisense of Path Intellisense, as they are 3rd party extensions.

@borekb
Copy link
Author

borekb commented Sep 18, 2018

Will do. By the way, I have many more extensions as shown in #57697 (comment), the screenshot is a small part of it.

@alexdima
Copy link
Member

One way I would approach this would be to open VS Code and do the minimal steps necessary to reproduce. From your extension list, it looks like you opened markdown files, JSON files and TS/JS files before reproducing. Every time you do something, it is more likely more extensions get activated and begin to do something ...

@vscodebot vscodebot bot closed this as completed Sep 25, 2018
@vscodebot
Copy link

vscodebot bot commented Sep 25, 2018

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@borekb
Copy link
Author

borekb commented Sep 26, 2018

@alexandrudima Hi, he're a profile of the following situation: no tabs open, only two files changed in SCM panel: package.json and yarn.lock. I started profiling, clicked yarn.lock, seen the diff open, clicked pakcage.json, it did not open so I stopped profiling and exported this file:

CPU-20180926T065255.265Z.cpuprofile.txt

@borekb
Copy link
Author

borekb commented Sep 26, 2018

BTW, I see the same behavior not only in the SCM panel but also e.g. with the Git Tree Compare extension which also opens diffs.

@alexdima
Copy link
Member

alexdima commented Oct 8, 2018

@borekb In the CPU profile you have attached, there is a lot of CPU usage in a method named getGitProviderOwnerAndRepositoryFromGitConfig. Almost like it is called in a loop or something:

screen shot 2018-10-08 at 15 24 30

After searching for the long method name on GitHub, I had a hit here

So it would be best to reach out to @KnisterPeter and create an issue directly at https://github.com/KnisterPeter/vscode-github .

@borekb
Copy link
Author

borekb commented Oct 8, 2018

@alexandrudima Thanks! Will do.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants