PythonCExtensions
PythonCExtensions copied to clipboard
Comparing the performance of Python, NumPy and C extensions
PythonCExtensions
Using a Python C extension and comparing its performance to NumPy and Python
You need to build the C extension before running this. To build and install the extension run:
$ python3 setup.py install
stdtest.py has a main method which will compare Python, NumPy and the C extension for small arrays and plot the performance with matplotlib.
I've modified the wrapper to work both Python 2 and 3.
Results
Dependencies
Cython
$ pip3 install Cython
Pybind11
$ brew install pybind11