DEV Community

Gabor Szabo
Gabor Szabo

Posted on β€’ Originally published at szabgab.com

9 1 1

Why Rust? πŸ¦€ - Speed

If you use Python 🐍 , Perl πŸͺ , or Ruby πŸ”΄ then one of the advantages of Rust you'll find is it speed πŸš— and general efficiency.

There are several benchmarks showing that Rust code runs at virtually the same speed as C or C++ code while the 3 dynamic languages I mentioned are substantially slower.

There are researches showing that C/C++/Rust are about 70-80 times more energy efficient than the 3 dynamic language. πŸ“ˆ

A small integer in Python uses 28 bytes. in Rust it can be as low as 1 byte.
Python has the advantage of allowing arbitrary large integers, but I never need anything really really big. And it has a huge price.

Short-term programmer efficiency is probably better with the dynamic languages, but if we also take in account the time of bug-fixes then it is not clear that they are indeed better. Rust forces you to write code that will avoid a large set of issues that you would encounter later on. That is, you pay the price earlier.

It might or might not be what you want.

Why do you consider Rust? What problems do you face?

Size of integer in Python.

Energy efficiency of programming languages.

Benchmark, speed of programming languages

Upcoming live presentation about Rust thousands crate.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here β†’

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs