Dart as one of the fastest Languages

We all know benchmarks are just ultra-scoped iterations that must of the time say nothing about real life, but it is nice to see how dart is a great language and some time we don’t appreciate it.

This benchmark compares most popular languages and test them in a 1 billion nested loop iteration. Guess what place Dart has?

https://benjdd.com/languages2/

3 Likes

And the huge improvement in Dart performance in this benchmark is thanks to Dart maintainer @mraleph :slight_smile:

https://mrale.ph/blog/2024/11/27/microbenchmarks-are-experiments.html

2 Likes

It’s a nonsense benchmark that does not really mean anything in isolation and especially not when you compare across many languages. It’s like comparing books by the number of pages in them.

8 Likes

You are totally right, but when you get a 5000 page book in the best sellers you know it’s something special :upside_down_face:

I would be more interested in someone doing similar breakdown as @mraleph did for dart, for every language to try and push the limits of each language. I think it could be a lot closer then

And there would be interesting insights

2 Likes

In a sufficiently large group of developers you will find opinions from the entire range of possibilities - vocal supporters of such benchmarks who will use it to confirm their biases, people who just shrug ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯ when see it, and ones who detest such ways of comparing languages. I wouldn’t say that “community” has been super interested in this particular benchmark, at least compared to other online bubbles.

I think we should take the opportunity to educate developers about all the shortcomings and simplifications of such benchmarks, and maybe crave for more publicity for actual useful tests e.g. pushing json parsing to the limits or improving complex layout performance.

2 Likes

In some scenarios, Dart can be slower than certain languages that appear lower on various performance rankings. Don’t get me wrong—I love Dart—but its speed really depends on the specific situation you’re testing.

For example, I dislike using Dart for cryptographic operations because it’s noticeably slower compared to Rust. That’s why I rely on rust_dart packages for those tasks.

Overall, the Dart team and community contributors have done an excellent job. However, they can’t stop improving, as there are still areas where the language can be optimized. And yes, sometimes it’s not the language itself but the way certain packages are implemented that causes slower performance.