vscode-pull-request-github icon indicating copy to clipboard operation
vscode-pull-request-github copied to clipboard

Causes periodic lag in typing when combined with VSCodeVim

Open parched opened this issue 3 years ago • 10 comments

In one particular workspace I have, this extension causes laggy typing. When I hold down a key it repeats for about 1-2 seconds then hangs for about 0.5 seconds and then it repeats for about 1-2 seconds then hangs for about 0.5 seconds and so on. With VSCodeVim, typing goes through the extension host so I believe this extension must be blocking the extension host periodically. I've attached an extension host profile that may give some clues.

  • Extension version: v0.42.0
  • VSCode Version: 1.67.1 (user setup) Commit: da15b6fd3ef856477bf6f4fb29ba1b7af717770d Date: 2022-05-06T12:37:03.389Z Electron: 17.4.1 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Windows_NT x64 10.0.19044

Steps to Reproduce:

  1. VSCodeVim
  2. This extension
  3. Something else that I'm not sure of because it only happens with one of my workspaces.

CPU-20220518T010913.545Z.cpuprofile.txt

parched avatar May 18 '22 01:05 parched

It looks like there's a lot of time spent in the built in git extension, which this extension does rely on. Next time it happens, can you also share the output from "GitHub Pull Request" and "Git"?

alexr00 avatar Jun 01 '22 09:06 alexr00

Ok, will do. I've just reenabled the extension but can't reproduce it. You may as well close this and I'll reopen with the logs if it happens again.

parched avatar Jun 02 '22 01:06 parched

👍 thanks @parched

alexr00 avatar Jun 02 '22 08:06 alexr00

@alexr00 It's happening again. I'm not exactly sure what I need to repro it, but I'll try and figure it out (I have some ideas). Here are the git logs in the mean time (this repeats every 0.5s or so as I'm typing).

[2022-06-03T05:01:11.519Z] > git status -z -uall [133ms]
[2022-06-03T05:01:11.572Z] > git symbolic-ref --short HEAD [49ms]
[2022-06-03T05:01:11.640Z] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/structs refs/remotes/structs [64ms]
[2022-06-03T05:01:11.707Z] > git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname) [63ms]
[2022-06-03T05:01:11.707Z] > git remote --verbose [59ms]
[2022-06-03T05:01:11.791Z] > git config --get commit.template [51ms]
[2022-06-03T05:01:12.471Z] > git diff 15d66b8ead28f188da2200c00636debc843d625d 6ba5c6c8292d6b8ce88046d3f07dc08b39cf35d2 [677ms]
[2022-06-03T05:01:12.748Z] > git ls-files --stage -- C:\path\to\repo\py-lib\src\holmes_design\ast.py [113ms]
[2022-06-03T05:01:12.813Z] > git cat-file -s 15d66b8ead28f188da2200c00636debc843d625d [61ms]
[2022-06-03T05:01:12.896Z] > git show --textconv :py-lib/src/holmes_design/ast.py [68ms]

I also had this pop up when I clicked "local pull request branches"

Element with id Local Pull Request Brancheshttps://github.com///pull/57 is already registered

parched avatar Jun 03 '22 05:06 parched

I took a look at where all those git calls could be coming from in this extension, and it looks like they should only occur when you open a file/diff. They are calls that could come from this extension though. When you see it again, can you also share the "GitHub Pull Request" log?

alexr00 avatar Jun 03 '22 13:06 alexr00

There's no logs from the extension while it happens, only these logs when it starts up

[Info] C:\Users\james.duley\.ssh\config: ENOENT: no such file or directory, open 'C:\Users\james.duley\.ssh\config'
[Info] Registering git provider
[Info] Looking for git repository
[Info] Found 1 repositories during activation
[Info] Git repository found, initializing review manager and pr tree view.
[Info] Review> Validate state in progress
[Info] Review> Validating state...
[Info] Found GitHub remote
[Info] Review> current branch structs is associated with pull request #107
[Info] Review> Resolving pull request
[Info] Review> Fetching pull request data
[Info] PullRequestTree> Adding PR #107 to tree
[Info] Review> register comments provider
[Info] Review> display pull request status bar indicator and refresh pull request tree view.
[Info] Review> using focus mode = true.
[Info] Review> state validation silent = true.
[Info] Review> PR show should show = false.

parched avatar Jun 03 '22 20:06 parched

I also don't have a diff open, but I did at some stage between now and when the issue wasn't happening.

parched avatar Jun 03 '22 20:06 parched

I've just realised it only happens in the file that has a change in the PR I have open.

parched avatar Jun 03 '22 20:06 parched

And if I close the PR, then refresh the extension and reopen the file then the problem is gone. If I then reopen the PR, refresh the extension and reopen the file, then the problem is back.

parched avatar Jun 03 '22 20:06 parched

@parched sorry for the slow response on this. Can you set "githubPullRequests.logLevel": "debug" in your settings, reproduce the issue, then share the output of GitHub Pull Request again?

alexr00 avatar Jul 29 '22 12:07 alexr00