Skip to content

Extension causes high cpu load when using poetry-version-plugin #18459

Closed

Description

@j0k2r
  • Issue Type: Performance
  • Extension Name: python
  • Extension Version: v2022.0.1786462952
  • OS Version: Linux 5.13.0-28-generic
  • VS Code version: 1.64

CPU profile file: CPU-20220207T092415.cpuprofile.txt

Activity

  1. added
    triage-needed
    on Feb 7, 2022
  2. added
    area-editor-*
    bug
    and removed
    triage-needed
    on Feb 7, 2022
  3. karrtikr commented on Feb 8, 2022

    @karrtikr

    Hi Hamza Z (@j0k2r) , the CPU profile you provided does not seem to be related to the Python extension. If you still face this issue, please upload the CPU profile again which will help us track down the issue. Follow the steps here:
    https://github.com/Microsoft/vscode/wiki/Performance-Issues#profile-the-running-extensions

  4. added
    info-needed
    on Feb 8, 2022
  5. j0k2r commented on Feb 8, 2022

    @j0k2r
    Author

    Kartik Raj (@karrtikr) thanks for the reply.

    Here is the new CPU profile:
    CPU-20220208T170531.156Z.cpuprofile.txt

  6. added
    investigating
    and removed
    info-needed
    on Feb 8, 2022
  7. karrtikr commented on Feb 8, 2022

    @karrtikr

    Thanks for the upload, unfortunately I still don't see any Python related stuff in the CPU profile. Did you activate the Python extension by opening a python file while the CPU profile was being captured?

  8. added
    info-needed
    on Feb 8, 2022
  9. j0k2r commented on Feb 9, 2022

    @j0k2r
    Author

    Hi Kartik Raj (@karrtikr), After lot of tests, it seems that the CPU load is caused by the poetry-version-plugin plugin.

    You can find a code example in https://github.com/j0k2r/vscode-cpu-load.

    The CPU load is caused by the lines in the Poetry configuration file. After deleting them vscode works normally.

  10. 7 remaining items

  11. j0k2r commented on Feb 9, 2022

    @j0k2r
    Author

    Python output:

    Experiment 'pythonaa' is active
    Experiment 'pythonTensorboardExperiment' is active
    Experiment 'PythonPyTorchProfiler' is active
    Experiment 'pythonDeprecatePythonPath' is active
    > conda info --json
    > poetry env list --full-path
    cwd: .
    > /bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    Python interpreter path: /bin/python
    > ~/.virtualenvs/Commander-YTgjDO02/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.local/share/virtualenvs/Commander-YTgjDO02/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.virtualenvs/NoSQLMap-XBIbzWiK/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.virtualenvs/csplogger-jqBk2i5A/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.virtualenvs/docker-hub-monitoring-36xI1Q85/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.local/share/virtualenvs/NoSQLMap-XBIbzWiK/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.virtualenvs/harbor-client-light-BDq5hhzd/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.virtualenvs/jostedal-u3av6PmQ/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.virtualenvs/pystun3-A5upV_oU/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    [ERROR 2022-1-9 17:21:40.15]: Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir 'poetry-version-plugin: Using __init__.py file at vscode_cpu_load'
    	at Object.readdirSync (fs.js:1021:3)
    	at Object.e.readdirSync (electron/js2c/asar_bundle.js:5:10478)
    	at /home/HOME/.vscode/extensions/ms-python.python-2022.0.1814523869/out/client/extension.js:24:259625
    	at /home/HOME/.vscode/extensions/ms-python.python-2022.0.1814523869/out/client/extension.js:24:259776
    	at Array.map (<anonymous>)
    	at h.initWatchers (/home/HOME/.vscode/extensions/ms-python.python-2022.0.1814523869/out/client/extension.js:24:259571)
    	at async h.ensureWatchersReady (/home/HOME/.vscode/extensions/ms-python.python-2022.0.1814523869/out/client/extension.js:52:4321)] {
      errno: -2,
      syscall: 'scandir',
      code: 'ENOENT',
      path: 'poetry-version-plugin: Using __init__.py file at vscode_cpu_load'
    }
    > ~/.virtualenvs/regexploit-k8BgdNqZ/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.virtualenvs/test_log-bxla1c6X/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.local/share/virtualenvs/harbor-client-light-BDq5hhzd/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.local/share/virtualenvs/jostedal-u3av6PmQ/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.local/share/virtualenvs/pystun3-A5upV_oU/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.local/share/virtualenvs/regexploit-k8BgdNqZ/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.local/share/virtualenvs/test_log-bxla1c6X/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > /bin/python2 ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > /usr/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > /usr/bin/python2 ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    > ~/.cache/pypoetry/virtualenvs/vscode-cpu-load-dmIhbhRY-py3.8/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/interpreterInfo.py
    Starting Pylance language server.
    

    poetry env list --full-path:

    poetry-version-plugin: Using __init__.py file at vscode_cpu_load/__init__.py for dynamic version
    poetry-version-plugin: Setting package dynamic version to __version__ variable from __init__.py: 1.0.0
    /home/HOME/.cache/pypoetry/virtualenvs/vscode-cpu-load-dmIhbhRY-py3.8 (Activated
    
  12. removed
    info-needed
    on Feb 9, 2022
  13. karrtikr commented on Feb 9, 2022

    @karrtikr

    Can you try the following VSIX https://github.com/microsoft/vscode-python/suites/5237804905/artifacts/161021046 and see if it helps? (Use Extension: Install from VSIX command to install the VSIX) If it doesn't, please provide the logs again, thanks!

  14. added
    info-needed
    on Feb 9, 2022
  15. j0k2r commented on Feb 10, 2022

    @j0k2r
    Author

    Hi Kartik Raj (@karrtikr), the new extension solves the problem, thanks for your help.

  16. added
    area-environments
    and removed
    info-needed
    investigating
    on Feb 10, 2022
  17. changed the title [-]Extension causes high cpu load[/-] [+]Extension causes high cpu load when using `poetry-version-plugin`[/+] on Feb 11, 2022
  18. locked as resolved and limited conversation to collaborators on Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-editor-*area-environmentsbugverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions