3 ms·
Except for some odd corner cases, it is very hard for a good engineer to beat compilers these days (they are very good now). Not to mention, tuning depends on t
by slashdave 2mo ago
Except for some odd corner cases, it is very hard for a good engineer to beat compilers these days (they are very good now). Not to mention, tuning depends on the platform, and often the exact model of chip.
- zero-sharp 2mo agothere were two lead developers from FFMPEG on Lex Fridman's youtube channel who talked about performance gain from assembly. They claimed the opposite https://www.youtube.com/watch?v=IUo0UwZOaRw https://www.youtube.com/watch?v=IUo0UwZOaRw
- slashdave 2mo agoYeah, a corner case (streaming) and good developers working very hard. The original SSE (SIMD) extensions were actually written with this use case in mind. When they first came out, the compilers were awful. They've since caught up.
- 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.
- rurban 2mo agoCertainly not. Every hand-optimized tight loop or lookup beats every compiler still. Compilers are extremely stupid, and esp. the language designers.