microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.71k stars 765 forks source link

High Memory Consumption, Long Operations constantly being rerun #4230

Closed whateverforever closed 1 year ago

whateverforever commented 1 year ago

Hi there,

thank you for this powerful tool! However, I routinely have to kill the pylance plugin, as it consumes either too much CPU or too much memory. In this case, it was memory (3-4 GB, which is a lot on my 16GB machine). I noticed that it is constantly repeating "long operations", without there being any changes to the files involved. Maybe this is relevant?

Environment data

Logs

Logs around the moment of the problem:

[Info  - 4:03:12 PM] (59233) Pylance language server 2023.4.10 (pyright d7616109) starting
[Info  - 4:03:12 PM] (59233) Server root directory: /home/<user>/.vscode/extensions/ms-python.vscode-pylance-2023.4.10/dist
[Info  - 4:03:12 PM] (59233) Starting service instance "<project-one>"
[Info  - 4:03:12 PM] (59233) Starting service instance "<project-two>"
[Info  - 4:03:12 PM] (59233) Starting service instance "<project-three>"
[Info  - 4:03:13 PM] (59233) Starting service instance "<project-four>"
[Info  - 4:03:13 PM] (59233) Starting service instance "<project-five>"
[Info  - 4:03:13 PM] (59233) Auto-indent enabled
[Info  - 4:03:14 PM] (59233) Background analysis(5) root directory: /home/<user>/.vscode/extensions/ms-python.vscode-pylance-2023.4.10/dist
[Info  - 4:03:14 PM] (59233) Background analysis(5) started
[Info  - 4:03:14 PM] (59233) Background analysis(1) root directory: /home/<user>/.vscode/extensions/ms-python.vscode-pylance-2023.4.10/dist
[Info  - 4:03:14 PM] (59233) Background analysis(1) started
[Info  - 4:03:14 PM] (59233) Background analysis(3) root directory: /home/<user>/.vscode/extensions/ms-python.vscode-pylance-2023.4.10/dist
[Info  - 4:03:14 PM] (59233) Background analysis(3) started
[Info  - 4:03:14 PM] (59233) Background analysis(4) root directory: /home/<user>/.vscode/extensions/ms-python.vscode-pylance-2023.4.10/dist
[Info  - 4:03:14 PM] (59233) Background analysis(2) root directory: /home/<user>/.vscode/extensions/ms-python.vscode-pylance-2023.4.10/dist
[Info  - 4:03:14 PM] (59233) Background analysis(2) started
[Info  - 4:03:14 PM] (59233) Background analysis(4) started
[Info  - 4:03:14 PM] (59233) Setting pythonPath for service "<project-five>": "/home/<user>/code/src/<project-five>/venv/bin/python"
[Warn  - 4:03:14 PM] (59233) stubPath /home/<user>/code/src/<project-five>/typings is not a valid directory.
[Info  - 4:03:14 PM] (59233) Assuming Python version 3.8
[Info  - 4:03:14 PM] (59233) Auto-excluding /home/<user>/code/src/<project-five>/venv
[Info  - 4:03:14 PM] (59233) Found 92 source files
[Info  - 4:03:14 PM] (59233) Setting pythonPath for service "<project-one>": "/usr/bin/python3"
[Warn  - 4:03:14 PM] (59233) stubPath /home/<user>/code/src/<project-one>/typings is not a valid directory.
[Info  - 4:03:14 PM] (59233) Assuming Python version 3.8
[Info  - 4:03:15 PM] (59233) Auto-excluding /home/<user>/code/src/<project-one>/venv
[Info  - 4:03:15 PM] (59233) Found 49 source files
[Info  - 4:03:15 PM] (59233) Setting pythonPath for service "<project-two>": "/usr/bin/python3"
[Warn  - 4:03:15 PM] (59233) stubPath /home/<user>/code/src/<project-two>/typings is not a valid directory.
[Info  - 4:03:15 PM] (59233) Assuming Python version 3.8
[Info  - 4:03:15 PM] (59233) Auto-excluding /home/<user>/code/src/<project-two>/venv
[Info  - 4:03:15 PM] (59233) Found 26 source files
[Info  - 4:03:15 PM] (59233) Setting pythonPath for service "<project-three>": "/usr/bin/python3"
[Warn  - 4:03:16 PM] (59233) stubPath /home/<user>/code/src/<project-three>/typings is not a valid directory.
[Info  - 4:03:16 PM] (59233) Assuming Python version 3.8
[Info  - 4:03:16 PM] (59233) Auto-excluding /home/<user>/code/src/<project-three>/venv
[Info  - 4:03:16 PM] (59233) Auto-excluding /home/<user>/code/src/<project-three>/venv36
[Info  - 4:03:17 PM] (59233) Found 134 source files
[Info  - 4:03:17 PM] (59233) Setting pythonPath for service "<project-four>": "/usr/bin/python3"
[Warn  - 4:03:17 PM] (59233) stubPath /home/<user>/code/src/<project-four>/typings is not a valid directory.
[Info  - 4:03:17 PM] (59233) Assuming Python version 3.8
[Info  - 4:03:17 PM] (59233) Auto-excluding /home/<user>/code/src/<project-four>/venv
[Info  - 4:03:17 PM] (59233) Auto-excluding /home/<user>/code/src/<project-four>/venv37
[Info  - 4:03:17 PM] (59233) Found 35 source files
[Info  - 4:03:42 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (21129ms)
[Info  - 4:03:42 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (22957ms)
[Info  - 4:06:06 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2777ms)
[Info  - 4:06:06 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2889ms)
[Info  - 4:06:12 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (4695ms)
[Info  - 4:06:12 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (4797ms)
[Info  - 4:06:14 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2085ms)
[Info  - 4:06:14 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2085ms)
[Info  - 4:06:27 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5986ms)
[Info  - 4:06:27 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (6261ms)
[Info  - 4:07:06 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3428ms)
[Info  - 4:07:06 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3516ms)
[Info  - 4:07:09 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2295ms)
[Info  - 4:07:09 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2367ms)
[Info  - 4:07:12 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2291ms)
[Info  - 4:07:12 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2356ms)
[Info  - 4:07:18 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2674ms)
[Info  - 4:07:18 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2674ms)
[Info  - 4:07:41 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (4563ms)
[Info  - 4:07:41 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (4698ms)
[Info  - 4:07:56 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2521ms)
[Info  - 4:07:56 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2574ms)
[Info  - 4:08:08 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2535ms)
[Info  - 4:08:08 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2606ms)
[Info  - 4:08:15 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2508ms)
[Info  - 4:08:15 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2508ms)
[Info  - 4:09:27 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (4856ms)
[Info  - 4:09:27 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5001ms)
[Info  - 4:10:06 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3696ms)
[Info  - 4:10:06 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3910ms)
[Info  - 4:10:18 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2713ms)
[Info  - 4:10:18 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2841ms)
[Info  - 4:10:24 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2540ms)
[Info  - 4:10:24 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2540ms)
[Info  - 4:10:34 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3596ms)
[Info  - 4:10:34 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3603ms)
[Info  - 4:11:19 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5626ms)
[Info  - 4:11:19 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5633ms)
[Info  - 4:12:33 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5611ms)
[Info  - 4:12:33 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5788ms)
[Info  - 4:16:11 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5003ms)
[Info  - 4:16:11 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5132ms)
[Info  - 4:27:28 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (6550ms)
[Info  - 4:27:28 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (6844ms)
[Info  - 4:30:22 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2147ms)
[Info  - 4:30:22 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2259ms)
[Info  - 4:31:01 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3533ms)
[Info  - 4:31:01 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3533ms)
[Info  - 4:31:09 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5588ms)
[Info  - 4:31:09 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5688ms)
[Info  - 4:31:19 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2371ms)
[Info  - 4:31:19 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2394ms)
[Info  - 4:31:39 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3352ms)
[Info  - 4:31:39 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3352ms)
[Info  - 4:31:46 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3879ms)
[Info  - 4:31:46 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3879ms)
[Info  - 4:32:47 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3803ms)
[Info  - 4:32:47 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3803ms)
[Info  - 4:33:07 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2329ms)
[Info  - 4:33:07 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2351ms)
[Info  - 4:34:21 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5341ms)
[Info  - 4:34:21 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5376ms)
[Info  - 4:34:38 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2413ms)
[Info  - 4:34:38 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2492ms)
[Info  - 4:34:52 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2250ms)
[Info  - 4:34:52 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2347ms)
[Info  - 4:35:11 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2398ms)
[Info  - 4:35:11 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2452ms)
[Info  - 4:35:18 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3381ms)
[Info  - 4:35:18 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3381ms)
[Info  - 4:35:34 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2447ms)
[Info  - 4:35:34 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2447ms)
[Info  - 4:37:33 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (8691ms)
[Info  - 4:37:33 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (8739ms)
[Info  - 4:40:29 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2827ms)
[Info  - 4:40:29 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2827ms)
[Info  - 4:40:36 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (6857ms)
[Info  - 4:40:36 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (6868ms)
[Info  - 4:41:59 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5517ms)
[Info  - 4:41:59 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5523ms)
[Info  - 4:42:09 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3102ms)
[Info  - 4:42:09 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3104ms)
[Info  - 4:43:37 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (4894ms)
[Info  - 4:43:37 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (4915ms)
[Info  - 4:43:57 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3831ms)
[Info  - 4:43:57 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3831ms)
[Info  - 4:45:08 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2978ms)
[Info  - 4:45:08 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (2985ms)
[Info  - 4:47:16 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (6646ms)
[Info  - 4:47:16 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (6722ms)
[Info  - 4:47:23 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (6474ms)
[Info  - 4:47:23 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (6700ms)
[Info  - 4:47:31 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3099ms)
[Info  - 4:47:31 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3099ms)
[Info  - 4:53:41 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3991ms)
[Info  - 4:53:41 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (3992ms)
[Info  - 4:53:46 PM] (59233) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5116ms)
[Info  - 4:53:46 PM] (59233) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (5333ms)

# I killed the pylance plugin, as it was consuming nearly 4GB of memory

[Info  - 11:13:29 AM] Connection to server got closed. Server will restart.
[Info  - 11:13:30 AM] (86552) Pylance language server 2023.4.10 (pyright d7616109) starting
[Info  - 11:13:30 AM] (86552) Server root directory: /home/<user>/.vscode/extensions/ms-python.vscode-pylance-2023.4.10/dist
[Info  - 11:13:30 AM] (86552) Starting service instance "<project-one>"
[Info  - 11:13:30 AM] (86552) Starting service instance "<project-two>"
[Info  - 11:13:30 AM] (86552) Starting service instance "<project-three>"
[Info  - 11:13:30 AM] (86552) Starting service instance "<project-four>"
[Info  - 11:13:30 AM] (86552) Starting service instance "<project-five>"
[Info  - 11:13:30 AM] (86552) Auto-indent enabled
[Info  - 11:13:30 AM] (86552) Setting pythonPath for service "<project-five>": "/home/<user>/code/src/<project-five>/venv/bin/python"
[Warn  - 11:13:30 AM] (86552) stubPath /home/<user>/code/src/<project-five>/typings is not a valid directory.
[Info  - 11:13:30 AM] (86552) Assuming Python version 3.8
[Info  - 11:13:31 AM] (86552) Auto-excluding /home/<user>/code/src/<project-five>/venv
[Info  - 11:13:31 AM] (86552) Found 92 source files
[Info  - 11:13:31 AM] (86552) Setting pythonPath for service "<project-one>": "/usr/bin/python3"
[Warn  - 11:13:31 AM] (86552) stubPath /home/<user>/code/src/<project-one>/typings is not a valid directory.
[Info  - 11:13:31 AM] (86552) Assuming Python version 3.8
[Info  - 11:13:32 AM] (86552) Auto-excluding /home/<user>/code/src/<project-one>/venv
[Info  - 11:13:32 AM] (86552) Found 49 source files
[Info  - 11:13:32 AM] (86552) Background analysis(1) root directory: /home/<user>/.vscode/extensions/ms-python.vscode-pylance-2023.4.10/dist
[Info  - 11:13:32 AM] (86552) Background analysis(1) started
[Info  - 11:13:32 AM] (86552) Background analysis(5) root directory: /home/<user>/.vscode/extensions/ms-python.vscode-pylance-2023.4.10/dist
[Info  - 11:13:32 AM] (86552) Setting pythonPath for service "<project-three>": "/usr/bin/python3"
[Warn  - 11:13:32 AM] (86552) stubPath /home/<user>/code/src/<project-three>/typings is not a valid directory.
[Info  - 11:13:32 AM] (86552) Assuming Python version 3.8
[Info  - 11:13:32 AM] (86552) Auto-excluding /home/<user>/code/src/<project-three>/venv
[Info  - 11:13:32 AM] (86552) Auto-excluding /home/<user>/code/src/<project-three>/venv36
[Info  - 11:13:32 AM] (86552) Found 134 source files
[Info  - 11:13:32 AM] (86552) Background analysis(2) root directory: /home/<user>/.vscode/extensions/ms-python.vscode-pylance-2023.4.10/dist
[Info  - 11:13:32 AM] (86552) Background analysis(2) started
[Info  - 11:13:32 AM] (86552) Background analysis(3) root directory: /home/<user>/.vscode/extensions/ms-python.vscode-pylance-2023.4.10/dist
[Info  - 11:13:32 AM] (86552) Background analysis(3) started
[Info  - 11:13:32 AM] (86552) Background analysis(4) root directory: /home/<user>/.vscode/extensions/ms-python.vscode-pylance-2023.4.10/dist
[Info  - 11:13:32 AM] (86552) Background analysis(4) started
[Info  - 11:13:32 AM] (86552) Background analysis(5) started
[Info  - 11:13:32 AM] (86552) Setting pythonPath for service "<project-two>": "/usr/bin/python3"
[Warn  - 11:13:32 AM] (86552) stubPath /home/<user>/code/src/<project-two>/typings is not a valid directory.
[Info  - 11:13:33 AM] (86552) Assuming Python version 3.8
[Info  - 11:13:33 AM] (86552) Auto-excluding /home/<user>/code/src/<project-two>/venv
[Info  - 11:13:33 AM] (86552) Found 26 source files
[Info  - 11:13:33 AM] (86552) Setting pythonPath for service "<project-four>": "/usr/bin/python3"
[Warn  - 11:13:33 AM] (86552) stubPath /home/<user>/code/src/<project-four>/typings is not a valid directory.
[Info  - 11:13:33 AM] (86552) Assuming Python version 3.8
[Info  - 11:13:33 AM] (86552) Auto-excluding /home/<user>/code/src/<project-four>/venv
[Info  - 11:13:33 AM] (86552) Auto-excluding /home/<user>/code/src/<project-four>/venv37
[Info  - 11:13:33 AM] (86552) Found 35 source files
[Info  - 11:13:55 AM] (86552) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (18108ms)
[Info  - 11:13:55 AM] (86552) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (19788ms)
[Info  - 11:16:25 AM] (86552) [BG(3)] Long operation: checking: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (6950ms)
[Info  - 11:16:25 AM] (86552) [BG(3)] Long operation: analyzing: /home/<user>/code/src/<project-three>/<...>/<...>/dataset.py (7251ms)

Trace log after setting TRACE and reloading vscode window is attached: 2023-04-12_pylance-bugreport.log

rchiodo commented 1 year ago

Thanks for the issue. It looks like there's two things going on here.

1) We're taking a long time to analyze the dataset.py file. Not sure why. If you could share that code or provide a file that repros the problem, that would make it possible for us to possibly fix what is taking so long.

2) Something else is writing to that file. Not sure what that might be, but some other process is probably touching that file. You might try something like this: https://github.com/Sysinternals/ProcMon-for-Linux to see what is writing to that file. Additionally it might be another VS code extension. Perhaps you can try again with just the Python and the Pylance extension installed?

alexlatif commented 1 year ago

I second a variant of this problem on Mac M2. Ever since the latest VScode release Version: 1.78.0 my Pylance is constantly trying to analyze 20 often 40 files at a time that are apparently "open". I am running Python 3.11 and have almost completely removed all extensions. When I removed Pylance its works like a dream as soon as I add it back my editor is so slow and buggy that it has become impossible to do any work. What can I provide to debug this?

rchiodo commented 1 year ago

@alexlatif it would be best if you opened a new issue. Please follow the directions here:

https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#filing-an-issue

github-actions[bot] commented 1 year ago

This issue has been closed automatically because it needs more information and has not had recent activity. If the issue still persists, please reopen with the information requested. Thanks.