5 ms·
What?
by benchaney 10y ago
What?
- to3m 10y agoThe point is: people are quick to say that taking advantage of undefined behaviour in the modern style is necessary to get best performance, and that this is worth the bother. But others (and I expect this person to be one of them) feel that perhaps good performance could be attained by some other route, one that doesn't involve the compiler stripping bits of your code out on an unanticipated technicality that requires ten paragraphs of legalese to explain. Especially not when the justification is something like "this would be hard to support on 1s complement" ;)
- the_why_of_y 10y agoYes, and this is why some of those others have designed the Rust language so that they can write programs that run fast without worrying about those tens of paragraphs of legalese. Same motivations for D, Swift and Go, except you get a bit less performance due to need for GC.
- marvy 10y agoI think what pizlonator meant is that some languages like C have pervasive undefined behavior. (For instance, INT_MAX + 1 is allowed to erase your hard drive.) The claim is that this allows compiler optimizations that would otherwise not be possible. The question is: how bad would that be? Let's turn off all these optimizations and see how much the benchmark scores drop. If everything is twice as slow, then maybe this undefined stuff is worth it. If everything is one percent slower, then maybe it's not.
- DrJokepu 10y agoI think the performance implications of bounds checking are fairly well studied.
- nickpsecurity 10y agoThat part of the field is still in exploration phase. The reason is that you can mix run-time checks with no checks for performance enhancement. Static analysis and other schemes are used to prove specific code doesn't need checks. The rest get checks automatically. Performance varies per scheme applied with overhead going down significantly over past decade. We don't yet know the answer on just how much spatial or temporal safety we can get at what cost.
- pizlonator 10y agoYou heard me. I'd be happy to explain any of the individual concepts if you are still confused.
- deleted 10y ago[deleted]