python 3.2 如何处理循环中的函数调用?
我不担心我定义的函数,而是内置函数或esp。来自导入模块的。基本上,这些建议仍然适用吗?
http://wiki.python.org/moin/PythonSpeed/PerformanceTips#Avoiding_dots。 ..
http://wiki.python.org/moin/PythonSpeed/PerformanceTips#Local_Variables
我认为 PyPy 的 JIT 也可以在这里帮助我,但我需要在 Linux 上运行它集群(我的源已经是 Py3k 的了)。
I am not worried about functions defined by me, but built-in functions or esp. ones from imported modules. Basically, do these pieces of advice still apply?
http://wiki.python.org/moin/PythonSpeed/PerformanceTips#Avoiding_dots...
http://wiki.python.org/moin/PythonSpeed/PerformanceTips#Local_Variables
I think the JIT of PyPy could have helped me here too, but I need to run the thing on a Linux cluster (and my source is for Py3k already).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。确切的版本并不重要。这些优化都归结为最大限度地减少语言功能的使用,其语义禁止在一般情况下进行简单有效的实现(这是解释器所关心的,而 JIT 编译器可以为特定情况生成更好的代码)。具体来说:
Yes. The exact version doesn't matter much. These optimizations all boil down to minimizing the use of language features with semantics that prohobit simple and efficient implementations for the general case (which is all an interpreter cares about, while a JIT-compiler can generate better code for specific cases). Specifically: