Performance Comparison: Rust vs PyO3 vs Python

Rust can be used to speed up Python code, but how fast can it be? This article highlights the comparison between the performance of: Rust, PyO3, and Python3, and an easy way to setup PyO3.

Marshal SHI
8 min readJul 21, 2020
Rust logo from rust-lang.org and Black Python logo from cleanpng.com. Composite logos image by author

Rust has seen rapid growth ever since Mozilla began sponsoring the project in 2009, and later announcing its development and release in 2010. As stated by the Octoverse in 2019, Rust has been the second fastest programming language in terms of growth and adoption by developers. Additionally, Rust has been voted to be the most loved language in a survey conducted by StackOverflow in 2020 . Rust’s growth is attributable by its evident pros, namely: robust performance and powerful security. Its performance matches that of C/C++, along with an added measure of security checks and memory management. For example, Rust does not allow dangling pointers.

Not far behind, Python was voted as the second most popular language amongst all programming languages. Python has been used in almost all programming environments and applications such as: web sites, operating systems, machine learning applications, data analyses and sciences, etc. In fact, most universities and schools use Python as in their introductory courses to programming and…

--

--

Marshal SHI
Marshal SHI

Written by Marshal SHI

Robots make our life easier | Robotics, Reinforcement Learning, Web, Python, Rust & Life Hacking. At MotivEdge.io

Responses (1)