Liste des Groupes | Revenir à se design |
On 11/2/2024 11:01 AM, Martin Brown wrote:Over a decade ago I hand optimized some vector code on the CELL processor. I then compiled some C++ code doing the same operations in nested loops with vector optimization turned on. The compiler was faster by a cycle when they found a load that could be done in parallel that I had missed.Most compilers these days are smart enough to move loop invariants outside of a loop and then dispose of the loop. You must have side effects in any code that you want to benchmark. Optimisers can be *really* smart about rearranging code for maximum performance by avoiding pipeline stalls. Only the very best humans can match them now.You need a few more asterisks stressing "really"! What's most amusing
is how the folks who write "clever"/obscure code fragments THINKING they
are "optimizing" it just annoy the compiler. On any substantial piece
of code, "you" simply can't outperform it. Your mind gets tired. You
make mistakes. The compiler just plows ahead. EVERY TIME IT IS INVOKED!
Les messages affichés proviennent d'usenet.