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

Create Imported Mode Sketch Server for use by Thonny #557

Open
hx2A opened this issue Nov 20, 2024 · 0 comments
Open

Create Imported Mode Sketch Server for use by Thonny #557

hx2A opened this issue Nov 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@hx2A
Copy link
Collaborator

hx2A commented Nov 20, 2024

From this discussion:

https://discourse.processing.org/t/new-windows-portable-bundle-with-thonny-ide-and-py5-0-10-0a0-out/43967/8

points out that running a Sketch through Thonny has an undesirable delay between the user hits the run button and when the Sketch window is open. Part of the delay is because the computer must start a new process that starts the JVM with all off the necessary Processing and py5 Jar files. Simply importing py5 itself does take a few seconds:

In [1]: %time import py5
Importing py5 on macOS but the necessary Jupyter macOS event loop has not been activated. I'll activate it for you, but next time, execute `%gui osx` before importing this library.
CPU times: user 3.19 s, sys: 708 ms, total: 3.9 s
Wall time: 4.99 s

And this machine in front of me is a MacBook Pro with an M1 chip.

Thonny launches each imported mode Sketch with a separate call to the command line tool, which must import py5 again each time. It would better to have some kind of Sketch server that imports py5 once and accepts requests from a client (ie Thonny) to launch Sketches. I don't think this would be that hard to build.

Also, such a Sketch server would be a better fit for using py5 via the PDE. The Sketch server doesn't magically solve some of the other PDE related problems discussed elsewhere but it would be a positive step for py5 + PDE.

@hx2A hx2A added the enhancement New feature or request label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant