Skip to content

Examples on how to setup numba, cython and c-extensions for speed improvements in Python projects

License

Notifications You must be signed in to change notification settings

rbaltrusch/python_performance_examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python performance examples

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.

Benchmarking graph

Note: software versions used were Python 3.8.8, Cython 0.29.23, numba 0.53.1 and Julia 1.7.3.

Getting started

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. source/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.

Contributions

To contribute, please read the contribution guidelines.

Python

Written in Python 3.8.8.

License

This repository is open-source software available under the MIT License.

Contact

Please raise an issue for code changes. To reach out, please send an email to richard@baltrusch.net.