I have a rather complicated python application that uses numpy, pandas, PySide, pyqtgraph and matplotlib, among other packages. When I associate the application with cx_Freeze on Windows, it comes with a speed of 349 MB.
My problem is that the resulting executable has a very long startup time of about 15 seconds. When I say start time, I mean the amount of time before any code is executed. I have a simple script that prints "Hello" on the console, and even this takes about 15 seconds.
Does anyone know of a solution to this problem or any ways to debug it? Is it slow because there are so many .dll files from so many packages?
EDIT: Using a great tool called Process Montor , I narrowed my problem down to the pytz module. On one specific load, 20 seconds were spent on the library.zip request (where cx_Freeze puts all the compiled bytecode) for pytz zoneinfo! I recently added pandas as a dependency, and pandas uses pytz.
See this image for sample Process Monitor output:

source
share