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

What is the catch with PyPy? If it was a drop-in replacement for CPython, wouldn't everyone choose it as the de-facto version of Python?


Some c modules are incompatible with PyPy. Two common ones are psycopg2 (PostgreSQL driver) and pyodbc (ODBC driver). There are alternatives that work but they don't have quite as many features (psycopg2cffi and pypyodbc). Ansible also runs slower in PyPy than CPython.


> Ansible also runs slower in PyPy than CPython

Do you know the reason?


I tested this with a playbook that installs a set of scripts and dependencies on a server. In all there's ~30 tasks. It takes ~1 minute using CPython 3.10 and ~1.5 minutes using PyPy 3.10 (v7.3.12). Ansible says libyaml is installed in both runtimes so that's ruled out. I wonder if it's the difference in interpreter start-up time, and it accumulates over time as Ansible starts so many Python processes as it runs its tasks.


It's hit and miss. Sometimes I get almost no improvement and sometimes I get 10x. But the slow warmup and up to 3x memory use (in my experience) really make me prefer CPython unless I have a very specific problem.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: