Comparing Clang and GCC Optimization - Part #4 - A Tutorial by Amir Kirsh

preview_player
Показать описание
Join Incredibuild Dev Advocate, Amir Kirsh, as he dives deeper into optimizing C++ compiler and playing with code using GCC and Clang.
Рекомендации по теме
Комментарии
Автор

Excellent video on a very important topic EVERY programmer needs to be aware of.
And this is a very 'simple' example - imagine what very questionable optimisations are going on in a large project...!!
This is exactly what I'm concerned about with the differences in machine code/assembly output between different compilers - for the same destination CPU architecture. Multiply this up to a large project and you can instantly see the potential for very significant performance gains/penalties (and code size), depending on your compiler.

On the other hand, it is far, far better to have real competition between the C++ compiler developers - drives innovation and improvement. Still(!!!), if performance and/or code size are important for you, you'll need to compare using different compilers - unless you are an assembly expert and thus can code those time-crucial sections in that language natively (or, can check the disassembly and amend if needed).

--> Big lesson, NEVER assume you compiler will produce code you cannot improve

ChrisM
Автор

I stopped using GCC. You can't do stuff like build it into a project without having to making it open source. You can build LLVM /clang into a project and not have to make it open source. So LLVM /Clang is much much more friendly for people wanting to make proprietary software like games that want to build in a compiler or JIT.

diconicabastion