vscode: Mcafee slowing down the application

Update from @isidorn: McAfee said that it took longer than expected to push the release with the fix out, but it is finally deployed to production with latest McAfee. It will take about 2 weeks to rollout it to most of our users. Please note, with the current implementation after system restart the very first launch of VS Code will be still slow, this will be addressed with the next McAfee release in the first half of November.


Type: Performance Issue

a week ago this issue started to happen. I don’t know why the vs does’t open fast like before. my pc performance is perfect and I have a very good specifications. corei7 16GB RAM 4G vega nevidia

and everytime I get a small window which has three options reopen, close, and wait program

VS Code version: Code 1.77.0 (7f329fe6c66b0f86ae1574c2911b681ad5a45d63, 2023-03-29T10:02:16.981Z) OS version: Windows_NT x64 10.0.22621 Modes: Sandboxed: No

System Info
Item Value
CPUs Intel® Core™ i7-8750H CPU @ 2.20GHz (12 x 2208)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 15.81GB (7.78GB free)
Process Argv –crash-reporter-id 8fd832f6-9de4-416f-89ae-88b2c3b75006
Screen Reader no
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
    0	    99	 43800	code main
    0	    28	  9816	   crashpad-handler
    0	    81	 27452	fileWatcher [1]
    0	   227	 43324	extensionHost [1]
    0	   114	 17044	     electron-nodejs ("C:\Users\obada\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node --max-old-space-size=3072 "c:\Users\obada\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --serverMode partialSemantic --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --cancellationPipeName C:\Users\obada\AppData\Local\Temp\vscode-typescript\439eb021dc574ea9b4a7\tscancellation-97ea4191a10871dac99e.tmp* --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc)
    0	    81	 37036	     electron-nodejs ("C:\Users\obada\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:\Users\obada\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\node\jsonServerMain" --node-ipc --clientProcessId=43324)
    0	   168	 40276	     electron-nodejs ("C:\Users\obada\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\obada\.vscode\extensions\streetsidesoftware.code-spell-checker-2.20.3\packages\_server\dist\main.js --node-ipc --clientProcessId=43324)
    0	    79	 49752	     electron-nodejs ("C:\Users\obada\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\obada\.vscode\extensions\kisstkondoros.vscode-gutter-preview-0.30.0\dist\server.js --node-ipc --clientProcessId=43324)
    0	   124	 50104	     electron-nodejs ("C:\Users\obada\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node --max-old-space-size=3072 "c:\Users\obada\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName C:\Users\obada\AppData\Local\Temp\vscode-typescript\439eb021dc574ea9b4a7\tscancellation-c1b3d0dc3cb7c5eb634d.tmp* --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc)
    0	    83	 13592	       electron-nodejs ("C:\Users\obada\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:/Users/obada/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/typingsInstaller.js" --globalTypingsCacheLocation C:/Users/obada/AppData/Local/Microsoft/TypeScript/5.0 --enableTelemetry --typesMapLocation "c:/Users/obada/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/typesMap.json" --validateDefaultNpmLocation)
    0	    77	 51608	     electron-nodejs ("C:\Users\obada\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\obada\.vscode\extensions\formulahendry.auto-rename-tag-0.1.10\packages\server\dist\serverMain.js --node-ipc --clientProcessId=43324)
    0	    88	 44932	window [5] (Issue Reporter)
    0	   149	 49156	   gpu-process
    0	   198	 49644	window [1] (getNumber.js - data-structure-algorethmes-udemy - Visual Studio Code)
    0	    48	 49652	   utility-network-service
    0	   104	 51852	shared-process
    0	    79	 11556	     ptyHost
Workspace Info
|  Window (getNumber.js - data-structure-algorethmes-udemy - Visual Studio Code)
|    Folder (data-structure-algorethmes-udemy): 48 files
|      File types: js(35)
|      Conf files:;
Extensions (23)
Extension Author (truncated) Version
vscode-color-picker Ant 0.0.4
github-markdown-preview bie 0.3.0
markdown-checkbox bie 0.4.0
markdown-emoji bie 0.3.0
markdown-footnotes bie 0.1.1
markdown-mermaid bie 1.18.0
markdown-preview-github-styles bie 1.0.1
markdown-yaml-preamble bie 0.1.0
path-intellisense chr 2.8.4
vscode-markdownlint Dav 0.49.0
gitlens eam 13.4.0
vscode-html-css ecm 1.13.1
prettier-vscode esb 9.10.4
auto-rename-tag for 0.1.10
code-runner for 0.12.0
vscode-pull-request-github Git 0.62.0
vscode-gutter-preview kis 0.30.0
emoji-icons mig 1.5.2
colorful-comments Par 1.0.0
material-icon-theme PKi 4.25.0
LiveServer rit 5.7.9
code-spell-checker str 2.20.3
material-theme zhu 3.15.8
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vscaat:30438848
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
nodejswelcome1cf:30587006
282f8724:30602487
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
2i9eh265:30646982
vsccsb:30677849
vscodedisable:30660115
pythonb192:30669360
functionswalk:30687959
pythonms35:30701012

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 48 (14 by maintainers)

Most upvoted comments

@deepak1556 Thanks it works fine now after putting the code.exe file in the excluded files list in McAfee.

Update from McAfee: the McAfee release that will tackle this issue is planned for end of August. Thank you

Update from @isidorn: McAfee team acknowledged this issue and are working on a fix. More details in this article with a workaround to exclude VS Code from being scanned: https://www.mcafee.com/support/?locale=en-US&articleId=TS103439&page=shell&shell=article-view

You cant just exclude files in organizations. Most users in orgs have 0 control over that. Unfortunately.

We have contacted the McAfee team and they acknowledged this issue and are working on a fix. More details in this article with a workaround to exclude VS Code from being scanned: https://www.mcafee.com/support/?locale=en-US&articleId=TS103439&page=shell&shell=article-view

@deepak1556 Thanks it works fine now after putting the code.exe file in the excluded files list in McAfee.

Hi, How to do this? Like how to add this code.exe file in excluded file list?

The McAfee app has a section called Real time scanning. If you open that it has a button to add files to exclude from scanning.

The path to code.exe is something like

C:\Users{UserName}\AppData\Local\Programs\Microsoft\vscode

Can users impacted provide the trace following the steps below to help us understand why the process launches are slow on your device, thanks!

  • Open Windows Performance Recorder from system start menu
  • Have the following settings

Screenshot 2022-08-23 200440

  • Start the recorder
  • Open the application
  • Once the editor has completely loaded, stop the recorder and save the profile
  • Send the profile to Deepak.Mohan@microsoft.com instead of attaching to this issue, since it will contain sensitive information.

OK, so I’d venture and dare to say: don’t use McAfee. There are better AV solutions out there. I know it’s not what some people want to hear, though 😃

Do you have McAfee antivirus installed, we had reports https://github.com/microsoft/vscode/issues/178733 , https://github.com/microsoft/vscode/issues/177570 with the AV slowing down startup with recent update.

of course. Okay I tried multiple things, I disabled all extensions, uninstalled the newest extensions and uninstalled vs code and reinstalled it again but still the same so I will follow the steps of Visual Studio Code starts up slowly

Two files of the startup CPU profile

prof-3Sj321Ml.main.cpuprofile.txt

prof-3Sj321Ml.renderer.cpuprofile.txt

System Info

  • Code: 1.77.0 (7f329fe6c66b0f86ae1574c2911b681ad5a45d63)
  • OS: win32(10.0.22621)
  • CPUs: Intel® Core™ i7-8750H CPU @ 2.20GHz(12 x 2208)
  • Memory(System): 15.81 GB(8.84GB free)
  • Memory(Process): 191.26 MB working set(128.03MB private, 2.82MB shared)
  • VM(likelihood): 0%
  • Initial Startup: true
  • Has 0 other windows
  • Screen Reader Active: false
  • Empty Workspace: false

Performance Marks

What Duration Process Info
start => app.isReady 7018 [main] initial startup: true
nls:start => nls:end 0 [main] initial startup: true
require(main.bundle.js) 73 [main] initial startup: true
start crash reporter 6966 [main] initial startup: true
serve main IPC handle 2 [main] initial startup: true
create window 24 [main] initial startup: true, state: 0ms, widget: 12ms, show: 11ms
app.isReady => window.loadUrl() 135 [main] initial startup: true
window.loadUrl() => begin to require(workbench.desktop.main.js) 20696 [main->renderer] NewWindow
require(workbench.desktop.main.js) 286 [renderer] cached data: YES, node_modules took 0ms
wait for window config 0 [renderer] -
init storage (global & workspace) 14 [renderer] -
init workspace service 26 [renderer] -
register extensions & spawn extension host 190 [renderer] -
restore viewlet 11 [renderer] workbench.view.explorer
restore panel 0 [renderer] -
restore & resolve visible editors 70 [renderer] 1: workbench.editors.gettingStartedInput
overall workbench load 375 [renderer] -
workbench ready 28545 [main->renderer] -
renderer ready 704 [renderer] -
shared process connection ready 0 [renderer->sharedprocess] -
extensions registered 28787 [renderer] -

Every time I start vs code

this message in the screenshot is showing every time I start vsCode (of course after taking sometime to see vs code itself). vscode-msg

Hi, hope this helps.

The first step is to try to reproduce the problem with all extensions disabled. You can disable the extensions either from the command line using the --disable-extensions command line argument, e.g., code --disable-extensions or from the … menu in the Extensions Viewlet:

image

If you cannot reproduce the issue when all extensions are disabled, then can you narrow down the extension by selectively disabling extensions? You can identify the extension which causes a performance issue by executing “F1 > Help: Start Extension Bisect”. This will run binary search on your installed extensions by disabling some, reloading the window, and asking you whether the issue that you saw still occurs, until a single extension has been identified.

McAfee does real time scanning, and this’s probably the reason vs code is running slow (since its scanning vs code too). You can exclude vs code from McAfee scanner.

Thanks @Neil-140301 for providing the ETW traces, we are now able to move the issue forward with Mcafee. Can any of the affected users check if launching the application using the following flags code.cmd --no-sandbox --disable-gpu-sandbox --disable-hang-monitor makes a difference after including the executable back into Mcafee scanning.

Thanks for the guidance. I have included code.exe file in the excluded files list in McAfee but i feel its not a good practice to do so. The purpose of antivirus is to scan the system for viruses etc.

Is there is a more feasible solution for this ?

@venkatrahul-software-development please see https://github.com/microsoft/vscode/issues/178962#issuecomment-1547360886

Indeed anyone with the problem could help by responding to that call for information by @deepak1556