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

When using cnpm/pnpm, rg uses lots of CPU #35659

Closed
617450941 opened this issue Oct 6, 2017 · 61 comments
Closed

When using cnpm/pnpm, rg uses lots of CPU #35659

617450941 opened this issue Oct 6, 2017 · 61 comments
Assignees
Labels
search Search widget and operation issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@617450941
Copy link

update vscode 1.17.0 CPU usage at 100% rg.exe bug?

@ffxsam
Copy link

ffxsam commented Oct 6, 2017

Your report isn't very clear (not sure what rg.exe is), but on Ubuntu, I'm getting 100% cpu spikes just from typing.

I'm desperately looking for a way to download the version previous to this one.

@617450941
Copy link
Author

file location \Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg.exe

@617450941
Copy link
Author

image

@617450941
Copy link
Author

image

@cipchk
Copy link

cipchk commented Oct 6, 2017

run as administrator the problem still exists.

@chrmarti chrmarti added the search Search widget and operation issues label Oct 6, 2017
@chrmarti
Copy link
Contributor

chrmarti commented Oct 6, 2017

Could you check what the command arguments are?

@chrmarti
Copy link
Contributor

chrmarti commented Oct 6, 2017

Also: Does this happen immediately after opening the window or only after using Ctrl + P to show QuickOpen?

@617450941
Copy link
Author

If my project exists node_modules folder will appear cpu 100% of the situation

@lainekendall
Copy link

https://code.visualstudio.com/updates/v1_16
click update on left, the top of each page has download links for vs code

@newbienewbie
Copy link

Hi, the same bug occours on my Surface Pro3.

Env

OS: win64
VSCode Version: 1.17.0
locale: Chinese

How to reproduce

Openning a npm package containing a node_modules folder with VSCode 1.17.0 and doing nothing else ,the CPU usage of rg.exe will quickly grows to 80% above .

If I choose to wait for a min , the rg.exe will exit silently and the usage of CPU will fall down to 3% .

@chrmarti
Copy link
Contributor

chrmarti commented Oct 8, 2017

Everyone seeing this: Is this right after starting the application or only after using Ctrl + P (Cmd + P on Mac) to open a file?

Could you also check what command parameters rg is running with?

@newbienewbie
Copy link

newbienewbie commented Oct 9, 2017

@chrmarti Hi . sorry for the late reply.

Is this right after starting the application or only after using Ctrl + P (Cmd + P on Mac) to open a file?

It's right that the CPU usage grows quickly to 100% after starting the vscode , but I can't reproduce the error when openning a file using Ctrl+P.

what command parameters rg is running with

"c:\Program Files\Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg" --files --hidden --case-sensitive -g *.csproj -g *.sln -g *.csx -g **/*.csproj -g **/*.sln -g **/*.csx --no-ignore --follow -- .

however , when I used my desktop in my office in the morning today,I could not reproduce the same bug on my win7 x64 desktop : win7 professional x64 SP1( 6.1.7601 )

After going home , I come back to my Surface Pro3 (the Surface Pro3 OS: Microsoft Windows [版本 10.0.15063] x64) and try to disable extenstions to see whether it is caused by some extension. Here's my result:

with ms-vscode.csharp installed , the rg.exe will takes up a huge amount of CPU usage.
however , if I disable the ms-vscode.csharp extention ,opening a npm package containing node_modules folder will not cause the bug.

@617450941 @cipchk do you get the ms-vscode.csharp installed?

@617450941
Copy link
Author

My cpu no matter how long it is maintained at 100% in exchange for the old version did not appear this situation

@cipchk
Copy link

cipchk commented Oct 9, 2017

@newbienewbie @617450941
thx, can be confirmed ms-vscode.csharp extension that will cause rg.exe of CPU usage, fixed this to disable it.

but not all projects, have to meet the following qualifications:

  • large composite project (includes FE & C#)
  • has node_modules

@chrmarti
Copy link
Contributor

chrmarti commented Oct 9, 2017

Could you run the following command in Powershell from your workspace folder and let me know what the output is?

(Measure-Command { & 'C:\Program Files\Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg.exe' --files --no-ignore --follow --hidden -- . | Measure-Object –Line | Out-Default }).TotalSeconds

@chrmarti
Copy link
Contributor

chrmarti commented Oct 9, 2017

Also, what is the output of the following when run in Powershell while the rg.exe are running?

(Get-WmiObject Win32_Process -Filter "name = 'rg.exe'").CommandLine

@cipchk
Copy link

cipchk commented Oct 10, 2017

@chrmarti

enter Measure-Command command in workspace that run time error message:

PS D:\psdm-FE> (Measure-Command { & 'C:\Program Files\Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg.exe
' --files --no-ignore --follow --hidden -- . | Measure-Object –Line | Out-Default }).TotalSeconds
File system loop found: .\sys\manage\node_modules\es5-ext\node_modules\es6-iterator\node_modules\es5-ext points to an ancest
or .\sys\manage\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\es6-iterator\node_modules\es5-ext\node_modules\es6-iterator points to an a
ncestor .\sys\manage\node_modules\es6-iterator
File system loop found: .\sys\manage\node_modules\es5-ext\node_modules\es6-symbol\node_modules\es5-ext points to an ancestor
 .\sys\manage\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\es6-symbol\node_modules\es5-ext\node_modules\es6-symbol points to an ances
tor .\sys\manage\node_modules\es6-symbol
File system loop found: .\sys\manage\node_modules\_es5-ext@0.10.30@es5-ext\node_modules\es6-iterator\node_modules\es5-ext po
ints to an ancestor .\sys\manage\node_modules\_es5-ext@0.10.30@es5-ext
File system loop found: .\sys\manage\node_modules\_es6-iterator@2.0.1@es6-iterator\node_modules\es5-ext\node_modules\es6-ite
rator points to an ancestor .\sys\manage\node_modules\_es6-iterator@2.0.1@es6-iterator
File system loop found: .\sys\manage\node_modules\_es5-ext@0.10.30@es5-ext\node_modules\es6-symbol\node_modules\es5-ext poin
ts to an ancestor .\sys\manage\node_modules\_es5-ext@0.10.30@es5-ext
File system loop found: .\sys\manage\node_modules\_es6-symbol@3.1.1@es6-symbol\node_modules\es5-ext\node_modules\es6-symbol
points to an ancestor .\sys\manage\node_modules\_es6-symbol@3.1.1@es6-symbol
File system loop found: .\sys\manage\node_modules\cli-color\node_modules\es5-ext\node_modules\es6-iterator\node_modules\es5-
ext points to an ancestor .\sys\manage\node_modules\cli-color\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\cli-color\node_modules\es5-ext\node_modules\es6-symbol\node_modules\es5-ex
t points to an ancestor .\sys\manage\node_modules\cli-color\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\cli-color\node_modules\es6-iterator\node_modules\es5-ext\node_modules\es6-
iterator points to an ancestor .\sys\manage\node_modules\cli-color\node_modules\es6-iterator
File system loop found: .\sys\manage\node_modules\d\node_modules\es5-ext\node_modules\es6-symbol\node_modules\d points to an
 ancestor .\sys\manage\node_modules\d
File system loop found: .\sys\manage\node_modules\d\node_modules\es5-ext\node_modules\es6-iterator\node_modules\d points to
an ancestor .\sys\manage\node_modules\d
File system loop found: .\sys\manage\node_modules\d\node_modules\es5-ext\node_modules\es6-symbol\node_modules\es5-ext points
 to an ancestor .\sys\manage\node_modules\d\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\d\node_modules\es5-ext\node_modules\es6-iterator\node_modules\es5-ext poin
ts to an ancestor .\sys\manage\node_modules\d\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\es5-ext\node_modules\es6-iterator\node_modules\d\node_modules\es5-ext poin
ts to an ancestor .\sys\manage\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\es6-iterator\node_modules\d\node_modules\es5-ext\node_modules\es6-iterator
 points to an ancestor .\sys\manage\node_modules\es6-iterator
File system loop found: .\sys\manage\node_modules\es5-ext\node_modules\es6-symbol\node_modules\d\node_modules\es5-ext points
 to an ancestor .\sys\manage\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\es5-ext\node_modules\es6-iterator\node_modules\es6-symbol\node_modules\es5
-ext points to an ancestor .\sys\manage\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\es6-symbol\node_modules\d\node_modules\es5-ext\node_modules\es6-symbol poi
nts to an ancestor .\sys\manage\node_modules\es6-symbol
File system loop found: .\sys\manage\node_modules\es6-iterator\node_modules\es5-ext\node_modules\es6-symbol\node_modules\es5
-ext points to an ancestor .\sys\manage\node_modules\es6-iterator\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\es6-iterator\node_modules\es6-symbol\node_modules\es5-ext\node_modules\es6
-iterator points to an ancestor .\sys\manage\node_modules\es6-iterator
File system loop found: .\sys\manage\node_modules\es6-iterator\node_modules\es6-symbol\node_modules\es5-ext\node_modules\es6
-symbol points to an ancestor .\sys\manage\node_modules\es6-iterator\node_modules\es6-symbol
File system loop found: .\sys\manage\node_modules\es6-symbol\node_modules\es5-ext\node_modules\es6-iterator\node_modules\es5
-ext points to an ancestor .\sys\manage\node_modules\es6-symbol\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\es6-weak-map\node_modules\es5-ext\node_modules\es6-symbol\node_modules\es5
-ext points to an ancestor .\sys\manage\node_modules\es6-weak-map\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\es6-weak-map\node_modules\es5-ext\node_modules\es6-iterator\node_modules\e
s5-ext points to an ancestor .\sys\manage\node_modules\es6-weak-map\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\es6-symbol\node_modules\es5-ext\node_modules\es6-iterator\node_modules\es6
-symbol points to an ancestor .\sys\manage\node_modules\es6-symbol
File system loop found: .\sys\manage\node_modules\event-emitter\node_modules\es5-ext\node_modules\es6-symbol\node_modules\es
5-ext points to an ancestor .\sys\manage\node_modules\event-emitter\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\event-emitter\node_modules\es5-ext\node_modules\es6-iterator\node_modules\
es5-ext points to an ancestor .\sys\manage\node_modules\event-emitter\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\lru-queue\node_modules\es5-ext\node_modules\es6-symbol\node_modules\es5-ex
t points to an ancestor .\sys\manage\node_modules\lru-queue\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\lru-queue\node_modules\es5-ext\node_modules\es6-iterator\node_modules\es5-
ext points to an ancestor .\sys\manage\node_modules\lru-queue\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\memoizee\node_modules\es5-ext\node_modules\es6-iterator\node_modules\es5-e
xt points to an ancestor .\sys\manage\node_modules\memoizee\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\memoizee\node_modules\es5-ext\node_modules\es6-symbol\node_modules\es5-ext
 points to an ancestor .\sys\manage\node_modules\memoizee\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\timers-ext\node_modules\es5-ext\node_modules\es6-iterator\node_modules\es5
-ext points to an ancestor .\sys\manage\node_modules\timers-ext\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\timers-ext\node_modules\es5-ext\node_modules\es6-symbol\node_modules\es5-e
xt points to an ancestor .\sys\manage\node_modules\timers-ext\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_cli-color@1.1.0@cli-color\node_modules\es5-ext\node_modules\es6-iterator\
node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_cli-color@1.1.0@cli-color\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_cli-color@1.1.0@cli-color\node_modules\es5-ext\node_modules\es6-symbol\no
de_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_cli-color@1.1.0@cli-color\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_cli-color@1.1.0@cli-color\node_modules\es6-iterator\node_modules\es5-ext\
node_modules\es6-iterator points to an ancestor .\sys\manage\node_modules\_cli-color@1.1.0@cli-color\node_modules\es6-iterat
or
File system loop found: .\sys\manage\node_modules\_d@0.1.1@d\node_modules\es5-ext\node_modules\es6-iterator\node_modules\es5
-ext points to an ancestor .\sys\manage\node_modules\_d@0.1.1@d\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_d@0.1.1@d\node_modules\es5-ext\node_modules\es6-symbol\node_modules\es5-e
xt points to an ancestor .\sys\manage\node_modules\_d@0.1.1@d\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_d@1.0.0@d\node_modules\es5-ext\node_modules\es6-iterator\node_modules\d p
oints to an ancestor .\sys\manage\node_modules\_d@1.0.0@d
File system loop found: .\sys\manage\node_modules\_d@1.0.0@d\node_modules\es5-ext\node_modules\es6-iterator\node_modules\es5
-ext points to an ancestor .\sys\manage\node_modules\_d@1.0.0@d\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_d@1.0.0@d\node_modules\es5-ext\node_modules\es6-symbol\node_modules\d poi
nts to an ancestor .\sys\manage\node_modules\_d@1.0.0@d
File system loop found: .\sys\manage\node_modules\_d@1.0.0@d\node_modules\es5-ext\node_modules\es6-symbol\node_modules\es5-e
xt points to an ancestor .\sys\manage\node_modules\_d@1.0.0@d\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_es5-ext@0.10.30@es5-ext\node_modules\es6-iterator\node_modules\d\node_mod
ules\es5-ext points to an ancestor .\sys\manage\node_modules\_es5-ext@0.10.30@es5-ext
File system loop found: .\sys\manage\node_modules\_es6-iterator@2.0.1@es6-iterator\node_modules\d\node_modules\es5-ext\node_
modules\es6-iterator points to an ancestor .\sys\manage\node_modules\_es6-iterator@2.0.1@es6-iterator
File system loop found: .\sys\manage\node_modules\_es6-iterator@0.1.3@es6-iterator\node_modules\es5-ext\node_modules\es6-ite
rator\node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_es6-iterator@0.1.3@es6-iterator\node_modules\es5
-ext
File system loop found: .\sys\manage\node_modules\_es6-iterator@0.1.3@es6-iterator\node_modules\es5-ext\node_modules\es6-sym
bol\node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_es6-iterator@0.1.3@es6-iterator\node_modules\es5-e
xt
File system loop found: .\sys\manage\node_modules\_es5-ext@0.10.30@es5-ext\node_modules\es6-iterator\node_modules\es6-symbol
\node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_es5-ext@0.10.30@es5-ext
File system loop found: .\sys\manage\node_modules\_es6-symbol@2.0.1@es6-symbol\node_modules\es5-ext\node_modules\es6-iterato
r\node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_es6-symbol@2.0.1@es6-symbol\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_es6-iterator@2.0.1@es6-iterator\node_modules\es5-ext\node_modules\es6-sym
bol\node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_es6-iterator@2.0.1@es6-iterator\node_modules\es5-e
xt
File system loop found: .\sys\manage\node_modules\_es5-ext@0.10.30@es5-ext\node_modules\es6-symbol\node_modules\d\node_modul
es\es5-ext points to an ancestor .\sys\manage\node_modules\_es5-ext@0.10.30@es5-ext
File system loop found: .\sys\manage\node_modules\_es6-symbol@2.0.1@es6-symbol\node_modules\es5-ext\node_modules\es6-symbol\
node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_es6-symbol@2.0.1@es6-symbol\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_es6-weak-map@0.1.4@es6-weak-map\node_modules\es5-ext\node_modules\es6-ite
rator\node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_es6-weak-map@0.1.4@es6-weak-map\node_modules\es5
-ext
File system loop found: .\sys\manage\node_modules\_es6-weak-map@0.1.4@es6-weak-map\node_modules\es5-ext\node_modules\es6-sym
bol\node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_es6-weak-map@0.1.4@es6-weak-map\node_modules\es5-e
xt
File system loop found: .\sys\manage\node_modules\_event-emitter@0.3.5@event-emitter\node_modules\es5-ext\node_modules\es6-i
terator\node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_event-emitter@0.3.5@event-emitter\node_modules
\es5-ext
File system loop found: .\sys\manage\node_modules\_es6-iterator@2.0.1@es6-iterator\node_modules\es6-symbol\node_modules\es5-
ext\node_modules\es6-iterator points to an ancestor .\sys\manage\node_modules\_es6-iterator@2.0.1@es6-iterator
File system loop found: .\sys\manage\node_modules\_event-emitter@0.3.5@event-emitter\node_modules\es5-ext\node_modules\es6-s
ymbol\node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_event-emitter@0.3.5@event-emitter\node_modules\e
s5-ext
File system loop found: .\sys\manage\node_modules\_es6-iterator@2.0.1@es6-iterator\node_modules\es6-symbol\node_modules\es5-
ext\node_modules\es6-symbol points to an ancestor .\sys\manage\node_modules\_es6-iterator@2.0.1@es6-iterator\node_modules\es
6-symbol
File system loop found: .\sys\manage\node_modules\_es6-symbol@3.1.1@es6-symbol\node_modules\d\node_modules\es5-ext\node_modu
les\es6-symbol points to an ancestor .\sys\manage\node_modules\_es6-symbol@3.1.1@es6-symbol
File system loop found: .\sys\manage\node_modules\_es6-symbol@3.1.1@es6-symbol\node_modules\es5-ext\node_modules\es6-iterato
r\node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_es6-symbol@3.1.1@es6-symbol\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_es6-symbol@3.1.1@es6-symbol\node_modules\es5-ext\node_modules\es6-iterato
r\node_modules\es6-symbol points to an ancestor .\sys\manage\node_modules\_es6-symbol@3.1.1@es6-symbol
File system loop found: .\sys\manage\node_modules\_lru-queue@0.1.0@lru-queue\node_modules\es5-ext\node_modules\es6-iterator\
node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_lru-queue@0.1.0@lru-queue\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_lru-queue@0.1.0@lru-queue\node_modules\es5-ext\node_modules\es6-symbol\no
de_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_lru-queue@0.1.0@lru-queue\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_memoizee@0.3.10@memoizee\node_modules\es5-ext\node_modules\es6-iterator\n
ode_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_memoizee@0.3.10@memoizee\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_memoizee@0.3.10@memoizee\node_modules\es5-ext\node_modules\es6-symbol\nod
e_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_memoizee@0.3.10@memoizee\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_timers-ext@0.1.2@timers-ext\node_modules\es5-ext\node_modules\es6-iterato
r\node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_timers-ext@0.1.2@timers-ext\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\_timers-ext@0.1.2@timers-ext\node_modules\es5-ext\node_modules\es6-symbol\
node_modules\es5-ext points to an ancestor .\sys\manage\node_modules\_timers-ext@0.1.2@timers-ext\node_modules\es5-ext
File system loop found: .\sys\manage\node_modules\cli-color\node_modules\es5-ext\node_modules\es6-iterator\node_modules\d\no
de_modules\es5-ext points to an ancestor .\sys\manage\node_modules\cli-color\node_modules\es5-ext

>>>>>>>>>>MORE>>>>>>>>

 Lines Words Characters Property
 ----- ----- ---------- --------
530674


73.2568166

HTH! the ./sys/manage/package.json content:

{
  "name": "Manage",
  "version": "1.0.0",
  "author": "@cipchk",
  "dependencies": {
    "time-require": "^0.1.2"
  },
  "devDependencies": {
    "gulp": "^3.9.1",
    "gulp-angular-htmlify": "^2.3.0",
    "gulp-changed": "^3.1.0",
    "gulp-concat": "^2.6.0",
    "gulp-if": "^2.0.0",
    "gulp-inject": "^4.0.0",
    "gulp-livereload": "^3.8.1",
    "gulp-clean-css": "^3.5.0",
    "gulp-minify-html": "^1.0.6",
    "gulp-ng-annotate": "^2.0.0",
    "gulp-ng-html2js": "^0.2.2",
    "gulp-rename": "^1.2.2",
    "gulp-sass": "^3.1.0",
    "gulp-sync": "^0.1.4",
    "gulp-uglify": "^3.0.0",
    "gulp-util": "^3.0.7",
    "gulp-wrap": "^0.13.0",
    "path": "^0.12.7",
    "through2": "^2.0.1"
  }
}

@newbienewbie
Copy link

newbienewbie commented Oct 10, 2017

@cipchk I don't have my surface pro3 at hand , so I can't test the command now .

While on the desktop in my office , the first command will issue a lot of errors (os error 3) that complain about “File system loop found” and “path not found ”.

To get a complete output , you can redirect the stderr to a file like this :

(Measure-Command { & 'C:\Program Files\Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg.exe' --files --no-ignore --follow --hidden -- . | Measure-Object –Line | Out-Default }).TotalSeconds 2>out.txt

can you upload the complete out.txt ?

for the second command :

(Get-WmiObject Win32_Process -Filter "name = 'rg.exe'").CommandLine

the output is :

"C:\Program Files\Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg.exe" --files --no-ignore --follow -

Is that the same to your output ?

@cipchk
Copy link

cipchk commented Oct 10, 2017

@newbienewbie Yes.

my steps:

  1. run (Get-WmiObject Win32_Process -Filter "name = 'rg.exe'").CommandLine
  2. run (Measure-Command { & 'C:\Program Files\Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg.exe' --files --no-ignore --follow --hidden -- . | Measure-Object –Line | Out-Default }).TotalSeconds 2>out.txt

I confirmed that the run second command will 100% cpu!

so, the out.txt content.

@chrmarti
Copy link
Contributor

Could you rerun the Measure-Command... command without --follow, that will help us understand if performance would be better when not following symlinks?

Please run the Get-WmiObject command while VSCode is showing the problem (not when you run the other command, I was imprecise in my instructions).

@cipchk
Copy link

cipchk commented Oct 10, 2017

@chrmarti There will be no re.exe 100% CPU usage if without --follow.

the all output content:

PS D:\psdm-FE> (Measure-Command { & 'C:\Program Files\Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\r
g.exe' --files --no-ignore --hidden -- . | Measure-Object –Line | Out-Default }).TotalSeconds

Lines Words Characters Property
----- ----- ---------- --------
84062


1.217515

the --follow parameter into a key problem?

@chrmarti
Copy link
Contributor

@cipchk Which version of npm did you use to install the node_modules? I'm trying to reproduce the problem.

I'm not sure yet if removing --follow will be the best solution in your case.

@cipchk
Copy link

cipchk commented Oct 10, 2017

my env:

  • npm: 5.3.0
  • node: v8.5.0
  • system: win10 64bit
  • about vscode:
Version 1.17.0
Commit be377c0faf7574a59f84940f593a6849f12e4de7
Date 2017-10-04T23:45:46.804Z
Shell 1.7.7
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

and, the D:\psdm-FE\package.json content:

{
  "name": "ps-h5",
  "version": "1.0.0",
  "author": "@cipchk",
  "dependencies": {},
  "devDependencies": {
    "babel-preset-es2015": "6.24.1",
    "event-stream": "3.3.2",
    "gulp": "3.9.1",
    "gulp-angular-htmlify": "2.3.0",
    "gulp-babel": "6.1.2",
    "gulp-bom": "1.0.0",
    "gulp-buffer": "0.0.2",
    "gulp-changed": "3.1.0",
    "gulp-clean-css": "3.5.0",
    "gulp-concat": "2.6.0",
    "gulp-if": "2.0.2",
    "gulp-inject": "4.2.0",
    "gulp-livereload": "3.8.0",
    "gulp-minify-html": "1.0.4",
    "gulp-modify-file": "^1.0.0",
    "gulp-ng-annotate": "2.0.0",
    "gulp-ng-html2js": "0.2.0",
    "gulp-rename": "1.2.2",
    "gulp-sass": "3.1.0",
    "gulp-sequence": "^0.4.6",
    "gulp-sync": "0.1.4",
    "gulp-uglify": "3.0.0",
    "gulp-util": "^3.0.6",
    "gulp-wrap": "0.13.0",
    "lodash": "4.17.4",
    "map-stream": "0.0.7",
    "merge-stream": "1.0.1",
    "merge2": "1.0.2",
    "path": "0.12.7",
    "rev-hash": "^2.0.0",
    "run-sequence": "^2.2.0",
    "sort-keys": "^2.0.0",
    "through2": "2.0.0",
    "vinyl-file": "^3.0.0"
  }
}

All of the above.

@Hideer
Copy link

Hideer commented Jan 12, 2018

将vscode 中的 search.followSymlinks:设置为false亲测可行

@mccreeker
Copy link

mccreeker commented Jan 26, 2018

Same thing happened after re-cloning a repo folder and opening VS Code in it:

image
(unable to select or copy error message)

Windows 10 Task Manager says the file spiking the CPU for several minutes (and slowing down the computer) is C:\Program Files\Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg.exe

ripgrep should really not go above 50% CPU, it should limit itself.

@octogonz
Copy link

I am having this same issue. The command line looks like this:

"c:\Program Files\Microsoft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg" --files --hidden --case-sensitive -g /*.csproj -g /*.sln -g /*.csx -g /*.cake -g **/*.csproj -g **/*.sln -g **/*.csx -g **/*.cake --no-ignore --follow --quiet -- .

This operation is completely inappropriate in my environment. By design, the node_modules subfolder of my project contains thousands of symlinks into thousands of nested folders. It would never make sense for a tool to do a brute force search of this subfolder without an explicit request from the developer.

In my repro, I did not perform any searches using the search tab. I simply launch VS Code and it immediately spawns rg.exe.

Has anyone figured out why VS Code is doing this? It is it a plugin? Is it a misguided feature of VS Code itself?

@octogonz
Copy link

Workaround: Deleting rg.exe seems to eliminate the problem without any apparent loss of functionality in VS Code.

@warpdesign
Copy link
Contributor

warpdesign commented Feb 12, 2018

I am running into the same problem: the second I press ctrl+p it starts eating cpu.

What's cnpm? I just opened a directory using VSCode and have no idea what cnpm is.

@warpdesign
Copy link
Contributor

warpdesign commented Feb 12, 2018

@pgonzal Deleting rg.exe will probably break quick open/search features.

@warpdesign
Copy link
Contributor

warpdesign commented Feb 12, 2018

Setting search.followSymlinks to false doesn't help, at least not in VSCode 1.21-insiders or 1.20 stable. @chrmarti

note: I have removed every symlink, and also the node_modules directory but I still get the bug.

Here is the command line that's used:

"C:\program files\Microosft VS Code\resources\app\node_modules\vscode-ripgrep\bin\rg" --files --hidden --case-sensitive -g !**/.git -g !**/.hg -g !**/CVS -g !**/.DS_Store -g !**/node_modules -g !**/bower_components --no-ignore-parent --follow -- .

@superouman
Copy link

I also have the issue of VScode running at 100% cpu when doing a file search.

@octogonz
Copy link

@BurntSushi is this the same issue that you fixed in BurntSushi/ripgrep#633? If so does VS Code just need to upgrade?

@BurntSushi
Copy link

@pgonzal I think unfortunately there isn't a simple answer to that question. I guess the closest answer is "wontfix" or more like "unable to fix." There is just a fundamental limit on how fast a tool can process a directory tree containing 2 million entries. You'll need to read my comment to understand this issue from ripgrep's end. (Others are reporting issues even when symlinks are disabled, but I need a reproducible case outside of VS code on my end.)

@warpdesign
Copy link
Contributor

warpdesign commented Feb 13, 2018

I think I found a workaround: replacing the rg.exe binary by version 0.6.0 inside VS Code resources directory seems to have fixed the problem.

@BurntSushi
Copy link

BurntSushi commented Feb 13, 2018

@warpdesign Now that would be interesting. Can anyone provide the exact command being run (where 0.6.0 works and 0.7.1 or 0.8.0 doesn't) and a corpus to reproduce it with?

@chrmarti
Copy link
Contributor

What might explain the renewed interest here: We updated to ripgrep 0.7.1 for the VS Code 1.20 released last week. VS Code 1.19 was based on 0.6.0.

@chrmarti
Copy link
Contributor

@pgonzal The command arguments you posted indicate that the file search was triggered by an extension for C# that would activate for certain file types. Could you disable that extension and see if that works around the problem?

@chrmarti
Copy link
Contributor

@pgonzal One other thing to try first would be to make sure you have search.followSymlinks set to false in your settings. You command line arguments show --follow which is added to follow symlinks.

@chrmarti
Copy link
Contributor

@warpdesign Could you try running the original rg with the same command line arguments you posted from your project folder? Does that stop or slow down at some point? Any errors being shown?

@roblourens roblourens changed the title update vscode 1.17.0 CPU usage at 100% rg.exe bug? When using cnpm/pnpm, rg uses lots of CPU Feb 13, 2018
@roblourens
Copy link
Member

roblourens commented Feb 13, 2018

This issue is for a specific issue affecting people using cnpm/pnpm. The fix for that will probably come with #34711 and with extensions not making wide-ranging searches over all of node_modules. I don't want this to be a general discussion thread.

@warpdesign and anyone not using those tools, please open a new issue with specific repro steps. Also if you put old rg.exe into insiders 1.21, it will break, so make sure that search/quickopen works at all.

@shrivatsahosabettu
Copy link

rg.exe is using 100% disk space also. Please let me know if there is any alternative, or is this is going to fix soon?

image

@BurntSushi
Copy link

@shrivatsahosabettu AIUI, that's not disk space, but disk bandwidth. And rg.exe is only using a paltry 0.4MB/s in your screenshot.

@chrmarti
Copy link
Contributor

I think we have addressed this issue with QuickOpen and text search when there are a lot of symlinks (cnpm/pnpm) in the folder being searched by adding the setting search.followSymlinks. The workspaceContains trigger will be covered with #34711.

For any remaining issues, especially regressions between releases, please open a new issue so we can follow up with you on the details. Thanks.

@warpdesign
Copy link
Contributor

warpdesign commented Feb 16, 2018

@chrmarti I think you are closing the issue too quickly: as I said above, adding search.followSymlinks: false doesn't fix the bug for me. And I don't have that much symlinks.

Also, I need to be able to search through symlinks.

I'll open a new one but I think it's related.

@shrivatsahosabettu
Copy link

@BurntSushi. In the screen print only 2 items are running as of now. But some more are running below that also. One more thing I noticed is this will run for first 5-6 min of my VS Code launch where the disk will become 100%, after 5-6 min all the rg.exe will disappear and disk size will come down to 36-40.

@chrmarti
Copy link
Contributor

@warpdesign Let's continue the investigation in a new GitHub issue. It sounds like your problem is not the same we discussed and fixed here.

When you open a new issue could also do the following and include the result: Try running the original rg with the same command line arguments you posted above in your project folder? Does that stop or slow down at some point? Any errors being shown?

Thanks.

@chrmarti
Copy link
Contributor

@shrivatsahosabettu If this reproduces also with the setting "search.followSymlinks": false, please open a new issue so we can follow up with you on the details. Thanks.

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
search Search widget and operation issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests