3 ms·
>Have they ever measured? Yes. >Most data I've seen is that bounds checks cost less than 1% in real-world code So? I don't know where you got you data, but t
by pandaman 3y ago
>Have they ever measured?
Yes.
>Most data I've seen is that bounds checks cost less than 1% in real-world code
So? I don't know where you got you data, but the point of the article is that you don't have to pay for the stuff you don't need. Otherwise we could as well use Java or VBA because "most data" says that programs spend 99% of time waiting on IO. If your data shows that then go ahead and use it, other people have other data apparently.
- titzer 3y ago> the point of the article is that you don't have to pay for the stuff you don't need. I kind of don't get this attitude, TBH. A bad register allocation decision could cost 5% in the wrong circumstance, yet no one is suggesting reintroducing the register keyword, and rarely do they drop down to asm to get it. But as soon as the cost is for "safety" they're hell-bent on getting rid of it. Wth.
- pandaman 3y ago> A bad register allocation decision could cost 5% in the wrong circumstance 5% of what? >yet no one is suggesting reintroducing the register keyword If I understood you, you mean that some variable might be allocated on stack instead of register and we need "register" keyword to alleviate this? Not really, when such thing happens we write asm() block which has all capabilities of the old register keyword and much more. And if 5% is latency then who in real time would not get to asm() to get it? This whole talk of "1% this, 5% that" seems just some kind of reddit meme. Would you give me 1% of your income for nothing? If not then why would you increase latency by 1%? Would you write five line of assembly to get 5% raise? If you would, then why would not you want to do it to drop latency by that much?