Faster Python through Rust https://github.com/Alex-Addy/pysprings-speedy-python What is Rust? "Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety." - rust-lang.org zero-cost abstractions move semantics guaranteed memory safety threads without data races trait-based generics pattern matching type inference minimal runtime efficient C bindings Python -> Rust Options CFFI CTypes Cython rust-cpython PyO3 Steps to faster python Profile Pick better algorithm/data structure Try using Pypy If possible use numpy or another dedicated library Replace hot code with Rust Rewrite it in Rust Benchmark Methodology Run each thing 10 times Each run: generate image 1024x1024 Each run: complete 50 blending iterations Benchmark Results Impl Type Time (s) Python 100.59 Debug Rust 48.01 Debug Mixed 51.01 Pypy 11.56 Release Mixed 1.61 Release Rust 1.41