Strange delay for starting pyside6-deploy packaged app
-
Hello,
I have made a simple test creating a package of a very simple hello world QtWidgets scripts using the new pyside6-deploy script (https://doc.qt.io/qtforpython-6/deployment/deployment-pyside6-deploy.html).
The binary produced (for macOS) is quite small 19Mb, but it takes almost 5 seconds! for the screen to appear. If I run it the same script with the python interpreter, it would be instantaneous.What am I doing wrong? I didn't use any flag, but just
pyside6-deploy /path/to/main_file.py
as in the instructions.thx
-
@Antonio-C
I do not use MacOS, but Linux hasstrace
, does Mac offer this? If so you should be able to run:strace python3 your.py # or if it has produced a binary maybe you don't run `python3` and it's just: strace your.py
That would produce output for every system call it makes, file it opens etc. You would look through that to get clue what it's up to, especially if there is a "pause" in the output, e.g. accessing a file on the Internet or something.
man strace
will give you lots of options to reduce and target the output. Worth a try if MacOS offers it. -
@Antonio-C compared to a normal PySide application, how long does that take?
pyside6-deploy
uses Nuitka under the hood. It really compiles the Python code, creating C-based python extensions, so there might be some heavy lifting to make sure all the Qt dependencies are in place. Do you see a similar approach in other compiled apps? I haven't experience this at least on Linux.