DEV Community

Cover image for Go versus Rust in 2024: Measuring the Best with 15 Benchmarks for Everyday Tasks
Paul Nixer
Paul Nixer

Posted on

Go versus Rust in 2024: Measuring the Best with 15 Benchmarks for Everyday Tasks

This post idea was born in last several public and personal discussions with highlighting a lof of technical, political, personal and religious aspects. Both programming languages got success in last decade, but released in different times: Go in 2009 and Rust in 2015.

Go logo, ©Wikipedia

Some people think that Go and Rust are not direct competitors, but this is not quite true: they cross very often: console tools, desktop applications, web services, and more. The only non-crossing area is embedded, but here Rust is not very strong due to static linking and strong competition from C/C++. This means that in many cases you will have to choose between Go and Rust as the main language for your next project.

Rust logo, ©Wikipedia

The tests were not selected by code complexity or level of extravagance, the main pattern is popular tasks. Even in radically different projects like machine learning, networking, or audio processing, you can't escape the main building block: basic math like addition, string concatenation, sorting, hashing, parsing, and more. So let's dive deep and figure out what the code looks like and which is faster. Time is the most important here - the faster the better.

Check the benchmarks and final score at Nix Sanctuary.
Don't forget to subscribe and never miss new NS programming posts.

Top comments (1)

Collapse
 
marcello_h profile image
Marcelloh

That's bad, if you write a test in Go to be compliant with Rust, while some can be done much faster if you just stick to "how it is done in Go". So this benchmark doesn't say sh&t to me.