4 ms·
Has anyone tried to use PyPy to speedup Django?
by gourneau 16y ago
Has anyone tried to use PyPy to speedup Django?
- bobbyi 16y agoHere's a benchmark comparison of PyPy (1.4 and "latest") against CPython 2.6.2: http://speed.pypy.org/comparison/?exe=1%2B172,3%2B172,1%2BL,3%2BL&ben=3,10&env=1&hor=false&bas=2%2B35&chart=normal+bars http://speed.pypy.org/comparison/?exe=1%2B172,3%2B172,1%2BL,... It's normalized so that CPython is 1.0 and lower numbers mean faster time on the benchmarks. The "django" benchmark is just template rendering. The "rietveld" benchmark is a full django app.
- kingkilr 16y agoThe template language is definitely faster than it, however currently the only database backend that PyPy has (that Django supports) is SQLite. At the moment SQLite is super slow on PyPy, because it's written using ctypes, we have an open branch to take ctypes from super slow to super fast (basically inline the ASM calls directly into JIT'd code, rather than make calls through libffi).
- jacobian 16y agoYes, though only on a single app -- a reasonably high-traffic content site. In this case, PyPy is roughly 10% faster (measured by comparing total view rendering time) but consumes about 2-3x as much RAM. Edit: I should clarify: this site doesn't use a DB engine but instead is pulling and rending content from an XML DB over a REST API. See Alex's note below about DB performance for why this is an important point.
- victorg 16y agoI'm sure PyPY folks would love to know everything you can comfortably disclose about this use case :)
- xorglorb 16y ago> this site doesn't use a DB engine but instead is pulling and rending content from an XML DB over a REST API Just a random suggestion, but might it be easier (and less taxing) to have a background job pull the XML into a TMPFS (ramdisk) then update it every 5 minutes or so?