Posted on

Python and C++ (Part 1)

You can accelerate the performance of Python code by re-implementing performance sensitive sections in C/C++ (i.e. by utilizing SSE for instance) and then making it callable from Python by using Python’s ctypes library or alternatively exposing your C/C++ code as a Python extension module. I’ve put together a minimal github repo that demonstrates the ctypes approach here and another small project that demonstrates the python extension module approach here in case it’s of use to anyone.

Liked it? Take a second to support ben morris on Patreon!

Leave a Reply

Your email address will not be published. Required fields are marked *