Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?


I have a production Django application (the 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/

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!


Thanks! 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.


Awesome investigation!

Any cursory benchmarks? Does it feel faster?


I 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.


I would say, if you're familiar with virtualenv and things like that, about 15 minutes




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: