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

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2021
  • Join Incredibuild Dev Advocate, Amir Kirsh, as he dives deeper into optimizing C++ compiler and playing with code using GCC and Clang.
    For more C++ resources, visit our Incredibuild library at: www.incredibuild.com/resource...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 5

  • @ChrisM541
    @ChrisM541 2 ปีที่แล้ว

    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 on...!!!!!!

  • @yassineinsta7731
    @yassineinsta7731 2 ปีที่แล้ว

    Yes, you may have taken the time to think about how to put the algorithms to avoid errors and translate through the clang compiler and multiply the wasted time + fatigue * zero = 0
    Example :
    X = 10
    For (int I = 0; I < X;i++)
    ....
    # Here the clang compiler sets the not . condition
    If we change the variable x greater than 10, the program will not exit the loop

    • @yassineinsta7731
      @yassineinsta7731 2 ปีที่แล้ว

      # Here the clang compiler sets the not . condition
      X = 10
      For (int I = 0; I != X;i++)

  • @diconicabastion5790
    @diconicabastion5790 ปีที่แล้ว

    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.

    • @user-ke8ys6eq4y
      @user-ke8ys6eq4y 11 วันที่ผ่านมา +1

      Does that really matters you saying that you need to make gcc open source and no need to make clang open source where as clang from start itself is open source
      Give some sense bro