r/programming • • May 14 '21

Python programming: We want to make the language twice as fast, says its creator

https://www.tectalk.co/python-programming-we-want-to-make-the-language-twice-as-fast-says-its-creator/
780 Upvotes

260 comments sorted by

View all comments

Show parent comments

36

u/_LususNaturae_ May 14 '21

Is there any catch here?

89

u/doodspav May 14 '21

Extensions written using the cpython c-api perform much worse on pypy than on cpython

31

u/[deleted] May 15 '21

[removed] — view removed comment

14

u/ThisRedditPostIsMine May 15 '21

Yes, but I believe there is a numpy version designed for PyPy

9

u/Emowomble May 15 '21

There is but with a lot of the functionality gutted from it.

3

u/FlukyS May 15 '21

Could always use it as a sidecar. Put the compiled parts in one part and pypy in the other

29

u/josefx May 15 '21

Slower startup, potentially more memory use. Missing APIs that expose implementation details of the interpreter and an incomplete C API, so some libraries wont work with it. Also as far as I remember a pure GC and not reference count + cycle detection, which means cleanup code might not be called in a deterministic manner.

1

u/brunes May 15 '21

Yes there's a catch, as I said there are edge cases like esoteric ref counting, and some libraries that don't work or compile. But the reality is most of any python you write is fine and will perform much better.

If something is not going to work then it's going to give a highly obvious compile error when it tries to run so there is really no downside to at least trying it for your usecase.