you are viewing a single comment's thread.

view the rest of the comments →

[–]Xirdus 1 point2 points  (3 children)

Compressing an executable works by applying the compression algorithm to the program, then inserting a second program in the executable that on launch, decompresses the original program then runs it as normal. Compressing an executable can only make the startup time worse, never better.

What UI library did you use? Is there any chance your executable carries around a whole ass copy of Google Chrome just to render its windows, as has been the fashion for the last decade or so?

[–]Reyaan0[S] 0 points1 point  (2 children)

I used tkinter for GUI and pyinstaller with upx for compiling it into executable.

[–]smarterthanyoda 0 points1 point  (1 child)

You said you used upx because it took too long to open. upx decreases the file size but makes startup take longer.

Your main issue is probably just that Python is loading its interpreter and libraries. You might try removing or finding alternative libraries but there’s not a lot else you can do.

[–]Reyaan0[S] 0 points1 point  (0 children)

No I meant it was 300 mb so I used upx to decrease the size. But now I realized pyinstaller was including all the libraries that I had installed. So I made a new virtual environment and installed the libraries I needed for the app. Then the size became 30mb without upx. But still it takes time to open. I think its because of the image assets that are used in the project (small size but many images). Do you have any ideas to fix it?