-
-
Notifications
You must be signed in to change notification settings - Fork 16
Description
From this discussion:
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 sAnd 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.