Speeding up the python “import” loader

后端 未结 5 1399
逝去的感伤
逝去的感伤 2020-12-14 17:49

I\'m getting seriously frustrated at how slow python startup is. Just importing more or less basic modules takes a second, since python runs down the sys.path looking for m

5条回答
  •  一个人的身影
    2020-12-14 18:05

    zipping up as many pyc files as feasible (with proper directory structure for packages), and putting that zipfile as the very first entry in sys.path (on the best available local disk, ideally) can speed up startup times a lot.

提交回复
热议问题