| ▲ | vbezhenar 2 hours ago | |
My understanding is that terminating program requires instructions and optimizing program involves removing "useless" instructions. If your code is littered with checks and jumps, it won't be faster than code without these checks and jumps. In other words: if you write `a[i]` in C, the compiler could either add index checks if its knows the size of `a` with `abort()` calls; or it can just compile it to single access instruction. The latter is faster. The former might be useful for debug build, I guess, but otherwise it's too slow to be acceptable for C usage. | ||
| ▲ | nine_k 2 hours ago | parent [-] | |
Yes. Carrying around stuff like ASan / TSan and a ton of other checks is just pretty expensive, and it does not even guarantee much. They only way is to use a better language %) | ||