Examples on how to setup numba, cython and c-extensions for speed improvement in Python projects.
A benchmark of the different optimization approaches can be seen in the graph below. Note that the absolute runtime numbers shown may vary from machine to machine.
To get a copy of this repository, simply open up git bash in an empty folder and use the command:
$ git clone https://github.com/rbaltrusch/python_performance_examples
To run a particular example, change from the root of the repository into its example folder (e.g. examples/base_example), then follow the run instructions in the example's README.md file. Note that each example has a different set of dependencies that may need to be installed before running the example. These dependencies are documented in the requirements.txt file in the respective example folder.
To contribute, please read the contribution guidelines.
Written in Python 3.8.8.
This repository is open-source software available under the MIT License.
Please raise an issue for code changes. To reach out, please send an email to richard@baltrusch.net.