3 ms·
not really, compiling isnt a heuristic problem, it has a lot less randomness involved
by desterothx 2mo ago
not really, compiling isnt a heuristic problem, it has a lot less randomness involved
- eru 2mo agoDepends on your compiler. You could have a compiler that deliberately uses randomised algorithms. They are often faster and easier to understand and write. Though in practice you can get all the benefits of both determinism and (that kind of) randomisation by using a PRNG and saving the seed you are using. It's an open question roughly on par with P vs NP whether true randomisation is ever necessary, or whether PRNGs are enough. So far we haven't found any problem or algorithm where true RNG is necessary and good PRNG ain't enough.
- pcmasterr 2mo agoAlso, most (optimizing) compilers ”optimize” the code for a fixed amount of time, leading to better optimized binaries on faster computers. That’s why developers should have as fast computers money can buy!
- eru 2mo ago> That’s why developers should have as fast computers money can buy! I don't see the connection? Most local builds are done with debugging on and optimisation turned off anyway. And what you deliver to your customers is usually something you produce on your CI/CD server, not what's on any developer's machine. (And if you want reproducible builds https://en.wikipedia.org/wiki/Reproducible_builds https://en.wikipedia.org/wiki/Reproducible_builds you can't optimise for a specific wall clock time.) > Also, most (optimizing) compilers ”optimize” the code for a fixed amount of time, leading to better optimized binaries on faster computers. That’s why you should give your developers computers that have slow clocks!
- NooneAtAll3 2mo agothere's a reason reproducible builds are a thing and most compilations aren't