7 ms·
* it is very hard for a good engineer to beat compilers these days (they are very good now).* I keep hearing this for the last 20 odd years, yet I see evidence
by Keyframe 2mo ago
* it is very hard for a good engineer to beat compilers these days (they are very good now).*
I keep hearing this for the last 20 odd years, yet I see evidence to the contrary each and every day. It is hard and honest work though.
- okanat 2mo agoA good engineer isn't a godlike entity who knows all. They know when to bring in assembly and when to be satisfied with C / C++ / Rust compilers and steer the compiler. Assembly has unique advantages like guaranteed execution duration for cryptography or exact optimization of hot-loop computation. 99% of the even performance-sensive code doesn't need assembly and compilers beat good engineers in this category since API surface is big and complicated. For 1% very hot code or very sensitive code due to execution duration / predictability / throughput, humans usually code better than compilers. This is due to specialization and limited DoF problems that can be solved and optimized to hell.
- slashdave 2mo agoIndeed. Compilers do have to make compromises, and it is not possible from code alone to understand the tradeoffs.