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

Pylance draining battery by constantly triggering indexing? #7028

Open
eliasla opened this issue Mar 9, 2025 · 2 comments
Open

Pylance draining battery by constantly triggering indexing? #7028

eliasla opened this issue Mar 9, 2025 · 2 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@eliasla
Copy link

eliasla commented Mar 9, 2025

Type: Bug

Just by opening my project, pylance uses a lot of battery / cpu (Activity monitor says over 1000 for energy impact for a couple of seconds) by indexing like every 15 seconds or so. I'm looking at python language server log and it keeps saying this over and over again.

file:///Users/user/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist (refresh)
2025-03-09 17:19:47.404 [info] [Info  - 5:19:47 PM] (99085) Indexing(43) started
2025-03-09 17:19:47.587 [info] [Info  - 5:19:47 PM] (99085) scanned(43) 169 files over 1 exec env
2025-03-09 17:19:47.656 [info] [Info  - 5:19:47 PM] (99085) indexed(43) 169 files over 1 exec env
2025-03-09 17:19:47.667 [info] [Info  - 5:19:47 PM] (99085) Indexing finished(43).

Extension version: 2025.3.1
VS Code version: Code 1.98.0 (6609ac3d66f4eade5cf376d1cb76f13985724bcb, 2025-03-04T21:06:18.612Z)
OS version: Darwin arm64 24.3.0
Modes:

System Info
Item Value
CPUs Apple M4 Pro (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) 2, 2, 2
Memory (System) 24.00GB (0.83GB free)
Process Argv --crash-reporter-id cbd2752b-6d18-4dd8-8fe8-a20501ebfa4d
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc2:31192216
iacca1:31171482
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
8did9651:31230678
9064b325:31222308
copilot_t_ci:31222730
f5992895:31254866
jda6j935:31233686
5b33h341:31253271

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Mar 9, 2025
@bschnurr
Copy link
Member

bschnurr commented Mar 9, 2025

can you send a longer log to see whats triggering indexing

@eliasla
Copy link
Author

eliasla commented Mar 9, 2025

Sure. This is what happens when i open vscode.

2025-03-09 21:29:48.517 [info] (Client) Pylance async client (2025.3.1) started with python extension (2025.2.0)
2025-03-09 21:29:48.848 [info] [Info  - 9:29:48 PM] (7076) Server root directory: file:///Users/user/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist
2025-03-09 21:29:48.848 [info] [Info  - 9:29:48 PM] (7076) Pylance language server 2025.3.1 (pyright version 1.1.396, commit 3e2236a7) starting
2025-03-09 21:29:48.852 [info] [Info  - 9:29:48 PM] (7076) Starting service instance "my_service"
2025-03-09 21:29:48.911 [info] [Info  - 9:29:48 PM] (7076) Setting environmentName for service "my_service": "3.9.11 (my_service venv)"
2025-03-09 21:29:48.933 [info] [Info  - 9:29:48 PM] (7076) Setting pythonPath for service "my_service": "/Users/user/.virtualenvs/my_service/bin/python"
2025-03-09 21:29:48.948 [info] [Info  - 9:29:48 PM] (7076) No include entries specified; assuming /Users/user/dev/my_service/my_service
2025-03-09 21:29:48.980 [info] [Info  - 9:29:48 PM] (7076) Auto-excluding **/node_modules
2025-03-09 21:29:48.983 [info] [Info  - 9:29:48 PM] (7076) Auto-excluding **/__pycache__
2025-03-09 21:29:49.002 [info] [Info  - 9:29:49 PM] (7076) Auto-excluding **/.*
2025-03-09 21:29:49.015 [info] [Info  - 9:29:49 PM] (7076) Assuming Python version 3.9.11.final.0
2025-03-09 21:29:49.310 [info] [Info  - 9:29:49 PM] (7076) Found 856 source files
2025-03-09 21:29:49.342 [info] [Info  - 9:29:49 PM] (7076) Background analysis(1) root directory: file:///Users/user/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist
2025-03-09 21:29:49.343 [info] [Info  - 9:29:49 PM] (7076) Background analysis(1) started
2025-03-09 21:29:49.647 [info] [Info  - 9:29:49 PM] (7076) Indexer background runner(2) root directory: file:///Users/user/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist (index)
2025-03-09 21:29:49.670 [info] [Info  - 9:29:49 PM] (7076) Indexing(2) started
2025-03-09 21:29:49.975 [info] [Info  - 9:29:49 PM] (7076) scanned(2) 169 files over 1 exec env
2025-03-09 21:29:50.063 [info] [Info  - 9:29:50 PM] (7076) indexed(2) 169 files over 1 exec env
2025-03-09 21:29:50.089 [info] [Info  - 9:29:50 PM] (7076) Indexing finished(2).
2025-03-09 21:30:09.170 [info] [Info  - 9:30:09 PM] (7076) Indexer background runner(3) root directory: 
file:///Users/user/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist (refresh)
2025-03-09 21:30:09.170 [info] [Info  - 9:30:09 PM] (7076) Indexing(3) started
2025-03-09 21:30:09.368 [info] [Info  - 9:30:09 PM] (7076) scanned(3) 169 files over 1 exec env
2025-03-09 21:30:09.448 [info] [Info  - 9:30:09 PM] (7076) indexed(3) 169 files over 1 exec env
2025-03-09 21:30:09.471 [info] [Info  - 9:30:09 PM] (7076) Indexing finished(3).
2025-03-09 21:30:24.108 [info] [Info  - 9:30:24 PM] (7076) Indexer background runner(4) root directory: file:///Users/user/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist (refresh)
2025-03-09 21:30:24.108 [info] [Info  - 9:30:24 PM] (7076) Indexing(4) started
2025-03-09 21:30:24.288 [info] [Info  - 9:30:24 PM] (7076) scanned(4) 169 files over 1 exec env
2025-03-09 21:30:24.355 [info] [Info  - 9:30:24 PM] (7076) indexed(4) 169 files over 1 exec env
2025-03-09 21:30:24.367 [info] [Info  - 9:30:24 PM] (7076) Indexing finished(4).
2025-03-09 21:30:39.140 [info] [Info  - 9:30:39 PM] (7076) Indexer background runner(5) root directory: file:///Users/user/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist (refresh)
2025-03-09 21:30:39.140 [info] [Info  - 9:30:39 PM] (7076) Indexing(5) started
2025-03-09 21:30:39.313 [info] [Info  - 9:30:39 PM] (7076) scanned(5) 169 files over 1 exec env
2025-03-09 21:30:39.379 [info] [Info  - 9:30:39 PM] (7076) indexed(5) 169 files over 1 exec env
2025-03-09 21:30:39.389 [info] [Info  - 9:30:39 PM] (7076) Indexing finished(5).
2025-03-09 21:30:54.006 [info] [Info  - 9:30:54 PM] (7076) Indexer background runner(6) root directory: file:///Users/user/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist (refresh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants