pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

Need a setting to avoid analyzing all open files

Open camillol opened this issue 6 months ago • 3 comments

Type: Bug

Pylance's CPU/memory usage increases with the number of open files. I see that python.analysis.diagnosticMode only admits the values workspace and openFilesOnly, with the latter being the default; there may also be other features that trigger analysis of open files.

The problem is that I have a very big workspace, and I tend to end up with a very large number of open files as I work. This ends up making pylance slower and slower. I can improve things by manually closing a bunch of tabs, but it's a pain (especially with random unsaved files mixed in the midst) and I should not have to do that.

I'd like to be able to choose an even narrower setting, e.g. "only recent open files", covering only the most recent 20 (or some other reasonable limit).

Extension version: 2024.7.1 VS Code version: Code - Insiders 1.92.0-insider (1d82f317af9c90b96a433fd6a599e4b1d31869a3, 2024-07-29T20:49:57.414Z) OS version: Darwin arm64 23.6.0 Modes:

System Info
Item Value
CPUs Apple M2 Max (12 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 3, 4, 5
Memory (System) 32.00GB (0.06GB free)
Process Argv --crash-reporter-id 7b87a5b2-68e7-4d42-ad22-32e3bce2e5e7
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vscod805:30301674
vsaa593cf:30376535
py29gd2263:31024238
c4g48928:30535728
vscrpc:30624061
962ge761:30841072
pythongtdpath:30726887
welcomedialog:30812478
pythonnoceb:30776497
asynctok:30898717
dsvsc013:30777762
dsvsc014:30777825
dsvsc015:30821418
pythonregdiag2:30926734
pythonmypyd1:30859725
2e7ec940:31000449
pythontbext0:30879054
accentitlementst:30870582
dsvsc016:30879898
dsvsc017:30880771
dsvsc018:30880772
cppperfnew:30980852
pythonait:30973460
9c06g630:31013171
a69g1124:31018687
dvdeprecation:31040973
dwnewjupyter:31046869
newcmakeconfigv2:31071590
nb_pri_only:31057983
nativerepl1:31104042
refactort:31084545
pythonrstrctxt:31093868
hdi1a554:31091669
flightc:31105041
wkspc-onlycs-c:31106320
nativeloc1:31106922
wkspc-ranged-t:31106316

camillol avatar Jul 30 '24 23:07 camillol