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.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

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

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay