this post was submitted on 31 Aug 2023
111 points (94.4% liked)

Rust

5989 readers
30 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] words_number@programming.dev 1 points 1 year ago (1 children)

Yes, that optimization is finally enabled now. But even without it, programmers are less defensive when writing rust because of the freedom of UB, so they write more optimal code and use better architectures before the compiler even comes into play. It doesn't show in micro benchmarks, but in more complex software that has been written in rust from the start it's pretty obvious.

[โ€“] anlumo@feddit.de 1 points 1 year ago

I think that the excessive use of iterators is the reason for the more performant code. They allow for very good optimizations due to their compile time predictability.