Skip to content Skip to sidebar Skip to footer

Pypy Significantly Slower Than Cpython

I've been testing a cacheing system of my making. Its purpose is to speed up a Django web application. It stores everything in-memory. According to cProfile most of the time in my

Solution 1:

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.

Post a Comment for "Pypy Significantly Slower Than Cpython"