Exe file with poor performance

154 views
Skip to first unread message

OldNerd

unread,
Apr 26, 2021, 2:37:00 AM4/26/21
to PyInstaller
Hi all, this is my first post to this mailing list. Please excuse me if I'm doing something wrong.

I need help with the following:

  • I have developed a Python script which runs OK on a Raspberry Pi A+
  • I have successfuly generated an exe file using pyinstaller scriptname.py --onefile
  • When I run the exe file it runs with a veeery poor performance. When I say veeery poor I means it can't be used
Not sure if I'm doing something wrong (probably I'm) or this is to be exepected (which I doubt)...

What can I try in order to solve this?

Additional information:
  • my goal is to distribute the compiled version instead of the source file in order to minimize/avoid piracy
  • my scrip makes use of pygame and espeak

Many thanks in advance for any hint!

Best

bwoodsend

unread,
Apr 27, 2021, 3:47:19 AM4/27/21
to PyInstaller

Well --onefile can slow things down a little because it needs to unpack itself but not by that much. Try switching temporarily to --onedir and see if/how much difference it makes. If it’s a big difference then I can think of two possibilities:

  • I/O speed is the bottleneck. Raspberry Pis use and SD card instead of a built in SSD I believe?
  • You have some antiviral software on your Pi which will insist on sniffing everything in a --onefile build every time it unpacks (which is every time it runs).

Number 2 seems unlikely for Linux but it’s very common on Windows and macOS.

OldNerd

unread,
Apr 28, 2021, 8:02:59 AM4/28/21
to PyInstaller

@bwoodsend many thanks for your reply. I've used the --ondedir approach and it shows improvements, not big difference but better than before. I'll stay with this option.

You are right about the Pi using SD and also about no antiviral software on my Pi. Anyway the performance problems I've experienced happen during execution and not at startup time.

Again many thanks for your inputs.
Reply all
Reply to author
Forward
0 new messages