What is Cython? Python at the speed of C

What is Cython? Python at the speed of C

Python has a reputation for being one of the most convenient, richly outfitted, and downright useful programming languages. Execution speed? Not so much.

Enter Cython. The Cython language is a superset of Python that compiles to C. This yields performance boosts that can range from a few percent to several orders of magnitude, depending on the task at hand. For work bound by Python’s native object types, the speedups won’t be large. But for numerical operations, or any operations not involving Python’s own internals, the gains can be massive.

With Cython, you can skirt many of Python’s native limitations or transcend them entirely—without having to give up Python’s ease and convenience. In this article, we’ll walk through the basic concepts behind Cython and create a simple Python application that uses Cython to accelerate one of its functions.

To read this article in full, please click here