falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.5k stars 934 forks source link

Improve Pyston support #1918

Open vytas7 opened 3 years ago

vytas7 commented 3 years ago

Pyston is a faster and highly-compatible fork of CPython, aiming at CPython 3.8.8 compatibility at the time of writing.

Quick tests show that Pyston can speed up Falcon up to 2x, and interestingly, its JIT is faster than our cythonization of pure Python code, so if Pyston is detected, we should not do that. However, most of falcon.cyutil.* is still worth compiling, e.g., the C-based parse_query_string is still 2x faster than our Python implementation run in Pyston. Not to complicate the matters too much, we could opt to only cythonize cyutil if Pyston is detected.

Detecting Pyston: use hasattr(sys, "pyston_version_info") as per its maintainers' suggestions in https://github.com/pyston/pyston/issues/36.

vytas7 commented 3 years ago

Coordinate with https://github.com/falconry/falcon/pull/1709 -- we probably want to get PEP 517 stuff working properly first, to make the things easier.

CaselIT commented 3 years ago

For sure I think this should be after #1709