Cython [SEP] named after
Python interpreter.
Cython has a foreign function interface for invoking C/C++ routines and the ability to declare the static type of subroutine parameters and results, local variables, and class attributes.
A Cython program that implements the same algorithm as a corresponding Python program may consume fewer computing resources such as core memory and processing cycles due to differences between the CPython and Cython execution models. A basic Python program is loaded and executed by the CPython virtual machine, so both the runtime and the program itself consume computing resources.
A Cython program is compiled to C code, which is further compiled to machine code, so the virtual machine is used only briefly when the program is loaded.
Cython employs:
- Optimistic optimizations
- Type inference (optional)
- Low overhead in control structures
- Low function call overhead
Performance depends both on what C code is generated by Cython and how that code is compiled by the C compiler.
History.
Cython is a derivative of the Pyrex language, and supports more features and