Python thread for pre-importing modules

前端 未结 4 1588
抹茶落季
抹茶落季 2021-01-13 21:17

I am writing a Python application in the field of scientific computing. Currently, when the user works with the GUI and starts a new physics simulation, the interpreter imme

4条回答
  •  猫巷女王i
    2021-01-13 22:00

    The problem with this is that the imports must still complete before they are usable. Depending on when they're first used, the application could still have to block for 10 seconds before it could start up anyway. Much more productive would be to profile the modules and figure out why they take so long to import.

提交回复
热议问题