Announcement

Collapse
No announcement yet.

GCC vs. Clang On The Apple M1 Under Arch-Based Asahi Linux

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GCC vs. Clang On The Apple M1 Under Arch-Based Asahi Linux

    Phoronix: GCC vs. Clang On The Apple M1 Under Arch-Based Asahi Linux

    With the Arch Linux based Asahi Linux running well on the Apple M1 (aside from accelerated graphics and various other features not implemented yet), one of the areas I was curious about was how well LLVM Clang and GCC C/C++ compilers compete when running on the Apple M1 with Linux. In this article are some quick benchmarks looking at how the stock compilers on Asahi currently compare for Apple's Arm-based SoC.

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    If we eliminate those NCNN benchmarks, There is not much difference.
    Someone has to report NCNN poor performance to LLVM.

    Comment


    • #3
      hello michael
      I think the reason why clang is significantly slow is that openmp is not installed, so it is impossible to run ncnn benchmark in multiple threads

      You can first pacman -S openmp, and then compile it with clang

      In addition, the ncnn 20220420 version was released, bringing many new optimizations
      For example, xop, fma, avx2, avx512, vnni, avx_vnni for x86 architecture
      msa for mips architecture
      risc-v vector for risc-v architecture
      and vulkan tensorcore optimized for nvidia gpu

      It is recommended to use the latest version to test :P
      Last edited by nihui; 20 April 2022, 12:28 AM.

      Comment


      • #4
        Originally posted by nihui View Post
        hello michael
        I think the reason why clang is significantly slow is that openmp is not installed, so it is impossible to run ncnn benchmark in multiple threads

        You can first pacman -S openmp, and then compile it with clang
        If openmp wasn't installed, then GCC can't use openmp either, can it?

        Comment


        • #5
          Nowadays, everyone uses Arch btw…

          Comment


          • #6
            GCC is better than LLVM that was created for the sole purpose of exploiting the BSD license for the corporate world! What a revelation!

            Comment


            • #7
              Go, GCC, go!!! It feels great to beat the Apple-sponsored compiler in its home field! I mean, GCC kicked LLVM's ass so hard it basically turned into apple juice. And yes, I am a GCC fanboy and proud of it!

              Comment


              • #8
                Originally posted by oleid View Post

                If openmp wasn't installed, then GCC can't use openmp either, can it?
                They have different OpenMP libraries the GCC one called libgomp and the LLVM one called libomp. Understood!

                Comment


                • #9
                  Originally posted by eltomito View Post
                  And yes, I am a GCC fanboy and proud of it!
                  That's... kind of sad to be honest. Why stan a compiler? Use the better tool for the job.

                  Comment


                  • #10
                    Hello Michael,
                    When testing different CFLAGS/CXXFLAGS please give -ftree-vectorize a try (with GCC).

                    Comment

                    Working...
                    X