Skip to content

Extension causes high cpu load #25870

Closed
Closed

Description

@AlexSSCoelho
  • Issue Type: Performance
  • Extension Name: python
  • Extension Version: 2026.4.0
  • OS Version: Windows_NT x64 10.0.26200
  • Antigravity version: 1.107.0

⚠️ Make sure to attach this file from your home-directory:
⚠️file:///c%3A/Users/Concreta/AppData/Local/Temp/ms-python.python-unresponsive.cpuprofile.txt

Find more details here: https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load

Activity

  1. eleanorjboyd commented on Mar 18, 2026

    @eleanorjboyd
    Member

    Hi! This appears to be empty— do you have specific data on the high CPU load to report?

  2. AlexSSCoelho commented on Mar 18, 2026

    @AlexSSCoelho
    Author
  3. SaduluSama commented on Mar 25, 2026

    @SaduluSama

    I'm experiencing this issue as well. Upon launching the editor, everything runs normally as long as I don't open any Python files. However, the moment I open one and the editor starts loading plugin services, my CPU usage spikes to near 100%.

    The Python Language Server plugin works for a brief moment (about a minute), but then it gets interfered with by this specific plugin and stops functioning. This results in persistent high background CPU usage. I've tried different versions of the plugin, but the issue persists, so it doesn't seem to be version-specific. I suspect it might be caused by a recent VS Code update breaking compatibility.

    After multiple attempts of closing and reopening the editor, it suddenly worked normally once, but closing and reopening it again reverted it back to the high CPU usage state. During this state, rendering becomes laggy. While syntax highlighting still works, features like comment hints, code completion (IntelliSense), go-to-definition, and code suggestions all fail. There is also about a one-second delay when pressing Enter.

    After troubleshooting, I've ruled out conflicts with other extensions; this is definitely caused by the plugin itself.

  4. SaduluSama commented on Mar 25, 2026

    @SaduluSama

    Eleanor Boyd (@eleanorjboyd)
    Alright, after I sent my previous reply and reopened it, it started working again:

    • Open the editor
    • Open the folder
    • Close the folder
    • Reply to this issue (with some time gap in between)
    • Then reopen the folder
    • As long as I don’t close it, everything works normally
    • However, whenever I close and reopen the folder, everything reverts back to its original state.
      Python output logs:
    2026-03-25 16:40:12.202 [info] Environment discovery is managed by the Python Environment extension (ms-python.vscode-python-envs). Please check the "Python Environments" output channel for environment-related logs.
    2026-03-25 16:40:12.704 [info] [test-by-project] Activating project-based testing mode
    2026-03-25 16:40:12.704 [info] [test-by-project] Discovering projects for workspace: d:\Mili\LocalGits\any\UnitNote
    2026-03-25 16:40:12.704 [info] [test-by-project] Found 1 total Python projects from API
    2026-03-25 16:40:12.704 [info] [test-by-project] Filtered to 1 projects in workspace
    2026-03-25 16:40:12.704 [info] [test-by-project] Creating adapter for: UnitNote at file:///d%3A/Mili/LocalGits/%E3%80%90%E9%87%8D%E8%A6%81%E3%80%91/UnitNote
    2026-03-25 16:40:12.711 [info] [test-by-project] Registered 1 project(s) for d:\Mili\LocalGits\any\UnitNote
    2026-03-25 16:40:12.713 [info] [test-by-project] Activated 1 project(s) for d:\Mili\LocalGits\any\UnitNote
    2026-03-25 16:40:12.713 [info] [test-by-project] Subscribed to Python project changes
    2026-03-25 16:40:12.743 [info] > pyenv which python
    2026-03-25 16:40:12.743 [info] cwd: .
    2026-03-25 16:40:12.820 [info] Active interpreter [d:\Mili\LocalGits\any\UnitNote]:  C:\Users\Suli\AppData\Local\Programs\Python\Python310\python.exe
    2026-03-25 16:40:16.569 [info] Starting Pylance language server.
    
  5. eleanorjboyd commented on Mar 25, 2026

    @eleanorjboyd
    Member

    Hi AlexSSCoelho and @xihusuli,

    Thank you for reporting this issue. To help us investigate the high CPU usage, we need some additional information:

    1. [need] CPU Profile: as It's critical for identifying which code paths are consuming CPU.

    2. [optional] Output Logs: Please provide the contents of:

      • Python output channel (View → Output → Select "Python" from dropdown)
      • Python Environments output channel (important since discovery is managed by this extension)
    3. [optional] Test without Pylance: Does the high CPU issue occur if you disable the Pylance extension? This would help us determine if the issue is in Python, Python Environments, or Pylance.

    4. [optional] Extension list: Please share your installed extensions (code --list-extensions).

    @xihusuli — I noticed your logs show a working session (Pylance starting successfully). Could you capture the logs during the high CPU/non-responsive state?

    Thank you!

  6. SaduluSama commented on Mar 26, 2026

    @SaduluSama

    Eleanor Boyd (@eleanorjboyd)
    There is good news—that it might be an issue with VS Code itself; after a small VS Code update yesterday afternoon, this problem disappeared on its own.

    i5-12490F

    Pylance can work independently.

    The issue occurs when the Python extension is enabled alone—I've turned off all other extensions and kept only this one, and the problem still appears. This has been confirmed through thorough troubleshooting.

    The Python environment output channel was crazily outputting [], and compared to today's normal situation,the Python output is just as I replied above.

    You can ask AlexSSCoelho whether the issue has also been resolved in this VS Code update or not.

  7. eleanorjboyd commented on Apr 1, 2026

    @eleanorjboyd
    Member

    closing as this seems resolved- thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

info-neededIssue requires more information from postertriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions