Does PY2EXE Compile a Python Code to run Faster?

雨燕双飞 提交于 2019-12-20 03:15:16

问题


I really like the PY2EXE module, it really helps me share scripts with other co-workers that are super easy for them to use.

My question is: when the PY2EXE module compiles the code into an executable, does the resulting executable process faster?

Thanks for any replies!


回答1:


py2exe just bundles the Python interpreter and all the needed libraries into the executable and a few library files. When you run the executable, it uses the bundled interpreter to run your script.

Since it doesn't actually generate native code, the speed of execution should be about the same, possibly slower because of the overhead of everything being packaged up.




回答2:


Partly, it bundles the python environment with the 'precompiled' pyc files. These are already parsed into python byte code but they aren't native speed executables



来源:https://stackoverflow.com/questions/12056702/does-py2exe-compile-a-python-code-to-run-faster

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!