4 ms·
But the compilers have to optimize the crap code in big tech codebases by 0.5%, it saves a lot of money. Also performance doesn't matter that much and develope
by ozgrakkurt 16d ago
But the compilers have to optimize the crap code in big tech codebases by 0.5%, it saves a lot of money.
Also performance doesn't matter that much and developer time is more important btw, keep using react.
- muvlon 16d agoIt's not even about optimizing some big tech codebase by 0.5%. The progress guarantees in particular are in place s.t. Nvidia can choose a certain implementation strategy in Cuda C++ that has "surprising" consequences for users (one thread getting stuck in an infinite loop that never yields can livelock its entire warp) but still get to claim "full C++ standards compliance".
- JoshTriplett 16d agoSo let it livelock the entire warp when someone writes an infinite loop. Should we start replacing integer division by zero with INT_MAX so that people aren't "surprised" by their program crashing?
- muvlon 16d agoI mean that's what they did, and that's why there's that UB. All I'm saying is that this is the "weird platform behaviors exist and must be legalized by the standard" kind of UB and not the "we want a 0.5% win for benchmaxxing" kind of UB (the standard has plenty of both).
- fc417fc802 16d agoNo, they didn't. UB is a cop out and inserting yield is just plain bad. Locking up one or more threads in an implementation defined manner would be the outcome of least surprise (I already know it's going to lock up at least the one thread).
- mitxela 15d agoThe standards intended interpretation of UB was always intended to be something like "implementation defined, no documentation required" to allow for implementation weirdness, even unpredictable ones. It was compiler authors who decided do abuse this allowance to do really unintuitive things instead of weird platform weirdness.
- IcyWindows 15d ago100% There are implementations that have sane behavior for "UB" instead of making it an excuse to misbehave. The ISO standard is not the same as a language from a single vendor.
- mitxela 15d agoIIRC a lot of it was benchmark gaming between GCC and LLVM.
- cryptonector 15d agoBecause one can bleeping see that that's what would happen. Locking up a thread isn't a good thing, but it's a lot better than UB. There was never a need to make this UB.
- mitxela 15d agoIsn't that the strategy for most of the stuff in C++? It's the common denominator of a wide variety of platforms. That's why numbers didn't have to be two's complement and characters didn't have to be ASCII for ages.
- mschuetz 15d agoI don't see the issue. Just let wrong code do wrong things But let it do the expected wrong thing, rather than changing the code to something unexpected.
- cryptonector 15d ago"No." <-- the C++ committee.
- Dylan16807 15d agoGood luck defining "expected" for most of the more complex cases.
- mschuetz 14d agoSeems trivial to me for infinite loops. Nothing special to specify here, they're already specced by the definition of loops.
- vrighter 15d agoperformance doesn't matter.... so datacenters would be equally happy running software that runs half as fast but uses 10% more power?