this post was submitted on 08 Apr 2024
58 points (91.4% liked)

Rust

5771 readers
53 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
[–] TehPers@beehaw.org 6 points 5 months ago* (last edited 5 months ago)

I agree with the conclusion, and the exploration is interesting enough that I think it was worth sharing. Still, while the author seemingly knows this already based on their conclusion, it's still worth stressing: these kinds of microbenchmarks rarely reflect real world performance.

This toy case doesn't have many (if any) real world performance-sensitive applications. At best, using shapes in games comes to mind, but shapes there are often represented as meshes, and if you really need the area that much, you might find that precalculating the area once is more impactful on the performance than optimizing how fast the area is calculated.

Still, the author seems aware, and it seems to just be the author sharing their fun experiment.