PyPy significantly slower than CPython

一世执手 提交于 2019-12-03 12:08:18

Brushing aside the fact that PyPy might really be intrinsically slower for your case, there are some factors that could be making it unnecessarily slower:

  • Profiling is known to slow PyPy a lot more than CPython.
  • Some debugging/logging code can disable optimizations (by, e.g., forcing frames).
  • The server you're using can be a dominant factor in performance (think about how awful classic CGI would be with a JIT: it would never warm up). It can also simply influence results (different WSGI servers have shown various speed-ups).
  • Old-style classes are slower than new-style ones.
  • Even if everything is in memory, you could be hitting e.g. slow paths in PyPy's SQLite.

You can also check the JIT Friendliness wiki page for more hints about what can make PyPy slower. A nightly build will probably be faster too, as there are many improvements relative to 1.5.

A more detailed description of your stack (server, OS, DB) and setup (how did you benchmark? how many queries?) would allow us to give better answers.

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