Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PyPy 3.7 officially and auto-test it in CI #845

Merged
merged 1 commit into from
Oct 10, 2021
Merged

Conversation

nolar
Copy link
Owner

@nolar nolar commented Oct 10, 2021

PyPy might give 2-5x speedup and 2-3x less memory consumption on pure-Python scripts — compared to equivalent CPython 3.7. This enables Kubernetes operators in CPU-/RAM-tight environments without special improvements and optimizations from Kopf's side.

PyPy was unofficially supported and tested manually from time to time. With this change, let's make it official and automated.

Some implementation nuances:

MyPy is excluded from test-time dependencies: one of MyPy's sub-dependency ("typed-ast") fails at being installed (python/typed_ast#111). However, PyPy is not used for linting/type-checking, only CPython is. Therefore, MyPy is not needed for PyPy.

There are some slowdowns in CI: +2m30s mins for OS-/pip-dependencies — since no wheels are usually available for PyPy. And slower tests: 2m40s vs. 1m50s in CPython — my assumption is because JIT is not very useful for non-repetitive code fragments of tests (but should be faster at runtime; no proofs, though).

Coverage for PyPy is disabled completely — it makes it disastrously slow (13m vs. 3m). The internet hints it is because tracing is not compatible with JIT (old articles from 2013-2015).

@nolar nolar added the automation CI/CD: testing, linting, releasing automatically label Oct 10, 2021
@nolar nolar force-pushed the pypy-in-ci branch 5 times, most recently from 161d76e to 9fa135b Compare October 10, 2021 16:56
PyPy might give [2-5x speedup](https://speed.pypy.org/) and [2-3x less memory consumption](https://dev.nextthought.com/blog/2018/08/cpython-vs-pypy-memory-usage.html) on pure-Python scripts — compared to equivalent CPython 3.7. This enables Kubernetes operators in CPU-/RAM-tight environments without special improvements and optimizations from Kopf's side.

PyPy was unofficially supported and tested manually from time to time. With this change, let's make it official and automated.

Some implementation nuances:

MyPy is excluded from test-time dependencies: one of MyPy's sub-dependency ("typed-ast") fails at being installed (python/typed_ast#111). However, PyPy is not used for linting/type-checking, only CPython is. Therefore, MyPy is not needed for PyPy.

There are some slowdowns in CI: +2m30s mins for OS-/pip-dependencies — since no wheels are usually available for PyPy. And slower tests: 2m40s vs. 1m50s in CPython — my assumption is because JIT is not very useful for non-repetitive code fragments of tests (but should be faster at runtime; no proofs, though).

Coverage for PyPy is disabled completely — it makes it disastrously slow (13m vs. 3m). The internet hints it is because tracing is not compatible with JIT (old articles from 2013-2015).

Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
@nolar nolar enabled auto-merge October 10, 2021 17:04
@nolar nolar merged commit 7ba1771 into main Oct 10, 2021
@nolar nolar deleted the pypy-in-ci branch October 10, 2021 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation CI/CD: testing, linting, releasing automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant