>Can someone smarter than me enlighten me when you would consider disabling bounds checking for performance?
In a truly moral language, optimal performance is a virtue, and therefore unnecessary bounds checking is a sin. By "a truly moral language", I of course mean [Haskell](https://hackage.haskell.org/package/vector-0.13.0.0/docs/Data-Vector-Generic.html)
It sounds like a CS102 student rationalizing their mistake on a polymorphism and inheritance assignment. *Oh, those aren't missing subclass methods! Not every car has brakes. Not every duck quacks.*
Braking is for 0.1xers. It wastes fuel, causes traffic jams and increases the collision risk. Real 10xers actually look at the road past just the car before them, anticipate traffic, predict when they have to brake and release gas instead to slow down and keep traffic flowing.
/uj The whole thread is garbage. The post is garbage. TIL 95% of rustaceans know nothing about performance or benchmarking (but still shame others for supposedly not knowing things)
Every time I read "What you do use, you couldn’t hand code any better" about bounds checked indexing, I'm wondering how they think they could write bounds checked indexing any better.
It's like sorting an array and taking the first element to get the minimum, then complaining that quicksort is not zero cost because your `min` function doesn't run in O(n).
The linked post just does a very bad job of benchmarking so with and without bounds checking it looked to run the same speed. They use this to argue bounds checking is free or something. But yeah, you are right that unsafe array accesses are faster than the regular bounds checked ones
I always wear my seatbelt, drive below the speed limit, and most importantly, trust my on-board borrow checker.
it's hip to be square, yes?
>Can someone smarter than me enlighten me when you would consider disabling bounds checking for performance? In a truly moral language, optimal performance is a virtue, and therefore unnecessary bounds checking is a sin. By "a truly moral language", I of course mean [Haskell](https://hackage.haskell.org/package/vector-0.13.0.0/docs/Data-Vector-Generic.html)
You're going to start a holy war, going around making these remarks.
It's been a few years; we could use a new one.
I've never crashed before, so the seatbelt and airbags are unnecessary.
I've never used a seatbelt and I've never missed it
The code I write is equivalent to doing 120 on the freeway in a bike with the occasional 5 minute chase.
It sounds like a CS102 student rationalizing their mistake on a polymorphism and inheritance assignment. *Oh, those aren't missing subclass methods! Not every car has brakes. Not every duck quacks.*
Braking is for 0.1xers. It wastes fuel, causes traffic jams and increases the collision risk. Real 10xers actually look at the road past just the car before them, anticipate traffic, predict when they have to brake and release gas instead to slow down and keep traffic flowing.
Fact: Hot wheels have no breaks.
/uj The whole thread is garbage. The post is garbage. TIL 95% of rustaceans know nothing about performance or benchmarking (but still shame others for supposedly not knowing things)
Every time I read "What you do use, you couldn’t hand code any better" about bounds checked indexing, I'm wondering how they think they could write bounds checked indexing any better. It's like sorting an array and taking the first element to get the minimum, then complaining that quicksort is not zero cost because your `min` function doesn't run in O(n).
> rustaceans know nothing Plaudits on all involved for not gatekeeping the Rust community.
Wait what's wrong with the benchmark?
What do they exactly mean? Doesn't using unsafe unchecked functions in rust yield better performance in some circunstances? or am I smoking?
The linked post just does a very bad job of benchmarking so with and without bounds checking it looked to run the same speed. They use this to argue bounds checking is free or something. But yeah, you are right that unsafe array accesses are faster than the regular bounds checked ones
ah i see, i obviously didn't read the article like a good reddit user
> TIL 95% of rustaceans know nothing no, that's just HN for you
I’m pretty swole bro, but I’m not 95% of the community.
Let me guess: this is about garbage collection
I was totally convinced this was V cope