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

autoTestDiscoverOnSaveEnabled setting causing significant decreases in VS Code performance #21446

Closed
mudit2812 opened this issue Jun 16, 2023 · 5 comments
Assignees

Comments

@mudit2812
Copy link

mudit2812 commented Jun 16, 2023

Type: Bug

I ran extension bisect to figure out which extension was causing trouble with the performance of VS Code on my machine. Extension Bisect led to detecting vscode-python (and associated extensions pylint, isort, pylance) to be the problem causers. The troubles I commonly encounter include:

  • Using the built-in source control to stage changes, commit, push, pull changes, etc. can take over 10 minutes
  • Built in debugger takes over 10 minutes to start execution and sometimes gets stuck while stepping over/into lines after a break point
  • Copy/pasting, deleting, creating files/folders using the file explorer takes a very long time
  • Can't create new lines in code so I need to resort to copy-pasting new lines since the Enter key doesn't do anything.

The only way I can fix performance is by reloading the window, which I have to do over 10 times a day because the slowdowns are very consistent. This is a big headache for me as I code almost exclusively in Python.

Extension version: 2023.10.1
VS Code version: Code 1.79.0 (Universal) (b380da4ef1ee00e224a15c1d4d9793e27c2b6302, 2023-06-07T14:29:00.206Z)
OS version: Darwin arm64 22.5.0
Modes:

System Info
Item Value
CPUs Apple M1 (8 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 3, 2, 2
Memory (System) 16.00GB (0.15GB free)
Process Argv --crash-reporter-id 0bdbd0bc-c581-437f-8eff-d3312dcce3ec
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
3biah626:30602489
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
a9j8j154:30646983
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
03d35959:30757346
pythonfmttext:30731395
pythoncmv:30756943
fixshowwlkth:30730052
showindicator:30766890
pythongtdpath:30739704
i26e3531:30763805
dh2dc718:30763024

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jun 16, 2023
@karthiknadig karthiknadig self-assigned this Jun 20, 2023
@karthiknadig
Copy link
Member

This might be due to file system watching, can you enable these logs to see if it is being triggered to often. Would it be possible for you to provide a minimal repro or a repository that we can use to repro this.

Logging (local)
!!! This is ONLY when you open a local workspace, for remote see below !!!
We provide logging for file events when you enable verbose logging. Steps are:

  • open VSCode on the local workspace that shows the issue
  • select View | Command Palette...
  • select Developer - Set Log Level...
  • pick Trace
  • select Help | Toggle Developer Tools
  • select Console
  • filter the output by typing File Watcher into the filter box
  • attach the output when doing the operation that exhibits the issue

image

Logging (remote)
!!! This is ONLY when you open a remote workspace (WSL, Docker, SSH), for local see above !!!
We provide logging for file events when you enable verbose logging. Steps are:

  • open VSCode on the remote workspace that shows the issue
  • select View | Command Palette...
  • select Developer - Set Log Level...
  • pick Trace
  • select View | Output
  • select Log (Remote Server) from the dropdown
  • attach the output when doing the operation that exhibits the issue

image

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jun 21, 2023
@mudit2812
Copy link
Author

I set the

"python.testing.autoTestDiscoverOnSaveEnabled": true

setting to false and the slowdown disappeared completely. I will enable it and attach the file watcher output once I'm able to replicate the error.

Would it be possible for you to provide a minimal repro or a repository that we can use to repro this.

I'm working on the PennyLane repository. There are a lot of tests, which could be why this setting being enabled impacts performance so much.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jul 10, 2023
@mudit2812
Copy link
Author

Here's a snippet of the file watcher when I was noticing the performance degradation. The two major things I noticed were:

  • Not being able to create new lines
  • Git extension would not let me stage/commit changes
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/.tox/unit-tests/log/2-commands[0].log
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/.tox/unit-tests/log/2-commands[0].log
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [CHANGED] /Users/mudit.pandey/repos/braket-plugin-fork/.tox/unit-tests/log/1-install_package.log
log.ts:401 TRACE [File Watcher (parcel)] [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83295
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83298
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83299
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83302
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83306
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83309
log.ts:401 TRACE [File Watcher (parcel)] [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83298
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83300
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83301
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83295
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83298
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83299
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83302
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83306
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83309
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83300
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc.83301
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/test/unit_tests/__pycache__/test_translation.cpython-310-pytest-7.4.0.pyc
log.ts:401 TRACE [File Watcher (parcel)] [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83301.031808
log.ts:401 TRACE [File Watcher (parcel)] [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83306.705163
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83301.031808
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83306.705163
log.ts:401 TRACE [File Watcher (parcel)] [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83299.207696
log.ts:401 TRACE [File Watcher (parcel)] [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83300.822956
log.ts:401 TRACE [File Watcher (parcel)] [CHANGED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83301.031808
log.ts:401 TRACE [File Watcher (parcel)] [CHANGED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83306.705163
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83299.207696
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83300.822956
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [CHANGED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83301.031808
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [CHANGED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83306.705163
log.ts:401 TRACE [File Watcher (parcel)] [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83298.055672
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83298.055672
log.ts:401 TRACE [File Watcher (parcel)] [CHANGED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83298.055672
log.ts:401 TRACE [File Watcher (parcel)] [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83302.070035
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [CHANGED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83298.055672
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83302.070035
log.ts:401 TRACE [File Watcher (parcel)] [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83309.636014
log.ts:401 TRACE [File Watcher (parcel)]  >> normalized [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83309.636014
log.ts:401 TRACE [File Watcher (parcel)] [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage
log.ts:401 TRACE [File Watcher (parcel)] [ADDED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83295.542263
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83299.207696
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83300.822956
log.ts:401 TRACE [File Watcher (parcel)] [DELETED] /Users/mudit.pandey/repos/braket-plugin-fork/.coverage.MacBookAir-FVFG339QQ6LR.83302.070035
log.ts:401 

@karthiknadig
Copy link
Member

I think there might be two different problems here:

  1. I think the filtering for file watching should exclude pyc I think this might be causing the problem.
  2. For the Git extension issue it might be independent of this

/cc @eleanorjboyd Could you take a look at the pattern we use for file system watching in testing to see if we get *.pyc events?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 12, 2023
@karthiknadig karthiknadig changed the title Extension causing significant decreases in VS Code performance autoTestDiscoverOnSaveEnabled setting causing significant decreases in VS Code performance Jul 12, 2023
@eleanorjboyd eleanorjboyd removed the info-needed Issue requires more information from poster label Jul 12, 2023
@eleanorjboyd
Copy link
Member

closing since the fix will be the same as #21014. Thanks!

@eleanorjboyd eleanorjboyd added area-testing and removed triage-needed Needs assignment to the proper sub-team labels Jul 31, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants