News for hackers. Stuff that matters.
Re:The world could run on older hardware if software optimiz... by miloignis on Tuesday May 13, 2025 @10:34AM (#43973436)
It's not that simple either - normally, if you're doing some loops over a large array of pixels, say, to perform some operation to them, there will only be a couple of bounds checks before the loop starts, checking the starting and ending conditions of the loops, not re-doing the bounds check for every pixel.

So very rarely should it be anything like 3-4x the cost, though some complex indexing could cause it to happen, I suppose. I agree scopes are a decent way to handle it!

Re:The world could run on older hardware if software optimiz... by monkeyelite on Tuesday May 13, 2025 @03:16PM (#43976542)
You’re describing a situation where I - or a very smart compiler can choose when to bounds check or not to make that intelligent realization.