Get started with Cython
Cython is designed as a C-extension for Python. The developers can use Cython to speed up Python code execution. Performance gains are most significant in CPU-bound programs. Here is some cpu-intense code in python # cat compute_it.py import datetime import math def main(): t0 = datetime.datetime.now() do_math(num=30_000_000) dt = datetime.datetime.now() - t0 print("Done in {:,.2f} sec".format(dt.total_seconds())) def do_math(start=0, num=10): pos = start k_sq = 1000 * 1000 while pos < num: pos += 1 math.sqrt((pos - k_sq) * (pos - k_sq)) if __name__ == '__main__': main() Took 7.39 sec ...