29 ms·
And then what do you do when you upgrade compilers and the build starts failing? This isn’t a hypothetical, it happens in real life. Your only option at that p
by marklacey 7y ago
And then what do you do when you upgrade compilers and the build starts failing?
This isn’t a hypothetical, it happens in real life. Your only option at that point is roll back compilers and hope someone cares about the regression enough to fix it.
The point is the better model is to build the semantics into the language rather than relying on the whims of implementation.
Of course the semantic guarantees will likely be somewhat weak because of differences in ISAs, memory hierarchies, etc.
- Fronzie 7y agoAs fallback, I have unit-tests with a check on both correctness and the instruction count (and # of memory allocations in hot loops). Whereas the cpu cycle-count varies between runs, the instruction count does not. Linux has good support for performance counters, Windows requires a bit of work. So in this case, the compiler update would show a regression in the test suite, which needs to be addressed as part of the compiler upgrade. Of course, having this in the compiler would remove the need for unit tests.