3 ms·
So if I have an existing Django application in production, assuming no package compatibility issues, how long might it take to get it running with PyPy?
by 3131s 9y ago
So if I have an existing Django application in production, assuming no package compatibility issues, how long might it take to get it running with PyPy?
- fijal 9y agoI would say, if you're familiar with virtualenv and things like that, about 15 minutes
- StavrosK 9y agoI have a production Django application (the https://www.pastery.net https://www.pastery.net pastebin). Just for fun, I'm going to change the container's image from python:3 to pypy:3 and document what happens here. EDIT: * Failed building psycopg2. Apparently I need to use psycopg2cffi instead. Retrying... * manage.py now can't import Django. Hmm. * Yeah, I have no idea why it can't import Django. I took most of the settings out of settings.py, thinking it somehow caused an ImportError, but it still fails. I think I have to give up at this point, as I have no more guesses. * Turns out manage.py was trying to launch `/usr/bin/env python` and it needed `/usr/bin/env pypy3`. Seems odd to include a `python` binary on the image and not just alias it to `pypy3`, but it is what it is. Continuing... Welp, everything seems to be running just fine. Here's the diff of all the changes I had to make: https://www.pastery.net/rrjdfj/ https://www.pastery.net/rrjdfj/ Basically, install psycopg2cffi instead of psycopg2, use pypy3 for the interpreter instead of python, and add two lines to settings.py. All in all, pretty damn short!
- silviogutierrez 9y agoAwesome investigation! Any cursory benchmarks? Does it feel faster?
- StavrosK 9y agoI couldn't tell you, really, as I'm just browsing on my local machine. It feels about the same, but I didn't expect to see much difference.
- 3131s 9y agoThanks! I'll be doing this soon too then. Most of my apps don't rely on too many obscure packages and / or really large scientific computing packages, so I doubt I'll run into many problems either.