Mike Huls
1 min readSep 9, 2023

--

I see your point but I don't agree when you say I'm arguing for writing all code in Rust. What I tried to demonstrate with my article is that you can make great use of Python's development speed; you can very quickly create a working program.

At some point you might run into a performance-wall where Python just isn't fast enough no matter how optimized your code. In these cases you can rewrite this small piece of code that bottlenecks your program and re-write it in another language that handles its memory more efficient. In this article I demonstrate how to do this with Rust but there are many options like Cython, C etc etc.

This is also what i've mentioned in my article:

"The Python code and Rust code in this article are far from optimized for finding primes. The important thing is to demonstrate that we can optimize small chunks of Python with Rust and that we can compare the performance of these functions."

In summary: the goal is not to write the most optimal algorithm but to demonstrate that performance bottlenecks can be solved (depending on the nature of the bottleneck) by re-writing a small piece of your code in a more memory-efficient language like Rust.

--

--

Mike Huls
Mike Huls

Written by Mike Huls

I write about interesting programming-related things: techniques, system architecture, software design and how to apply them in the best way. — mikehuls.com

No responses yet