-
Notifications
You must be signed in to change notification settings - Fork 91
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
Workbench: Positron Python console slow or fails to start #5340
Comments
We need to prepare an environment to measure how long these activities are taking and capture more information when it doesn't work / is unacceptably slow. |
Did some analysis of this on Palm. Indeed, starting Python is pretty slow. It can take a full 15 seconds from the time we start the Python process until its sockets come online. Here are the supervisor logs from a session on Palm, note :41 -> :56 elapses while we are waiting:
Python itself boots in less than 1/10 of a second, so this isn't caused by Python itself being slow to open.
So this delay is being caused by the LSP and kernel startup. During this period, no output is emitted, so it's difficult to tell what is going on. |
I pulled a trace and discovered that the Python startup time on Workbench is entirely dominated by reading Python packages at startup. No individual package takes a long time, but there are a lot of packages to read. Here are some examples from a trace run on a local workbench env with a pyenv:
As another interesting datapoint, using Python in VS Code notebooks in VS Code with the Jupyter extension (which also uses ipykernel) is pretty snappy, restarting in 1-2s vs 15s for Positron (on similar hardware). |
See related #5596 |
System details:
Positron and OS details:
Positron Version: 2024.11.0 build 140
Code - OSS Version: 1.93.0
Commit: e0d844b
Date: 2024-10-31T14:13:54.986Z
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Interpreter details:
Python 3.12.4
Describe the issue:
Re-opening an existing project often fails to start a Python kernel
Steps to reproduce the issue:
mkdir python3-test
python -m venv .venv
and then source and installipykernel
Expected or desired behavior:
Python consoles should start up consistently.
Were there any error messages in the UI, Output panel, or Developer Tools console?
The text was updated successfully, but these errors were encountered: