www.phoronix.com Open in urlscan Pro
2a06:98c1:3121::3  Public Scan

Submitted URL: http://www.phoronix.com/review/apple-m1-compilers
Effective URL: https://www.phoronix.com/review/apple-m1-compilers
Submission: On March 01 via manual from VN — Scanned from NL

Form analysis 1 forms found in the DOM

https://www.google.com

<form action="https://www.google.com" id="cse-search-box" target="_blank">
  <div>
    <input type="hidden" name="cx" value="partner-pub-0253814508491313:1305299758">
    <input type="hidden" name="ie" value="UTF-8">
    <input type="text" name="q" placeholder="" style="background: url(&quot;https://www.google.com/cse/static/images/1x/en/branding.png&quot;) left 9px top 50% no-repeat rgb(255, 255, 255);">
    <input type="submit" name="sa" value="Search">
  </div>
  <input name="siteurl" value="www.phoronix.com/review/apple-m1-compilers" type="hidden"><input name="ref" value="" type="hidden"><input name="ss" value="" type="hidden">
</form>

Text Content

WE VALUE YOUR PRIVACY

We and our partners store and/or access information on a device, such as cookies
and process personal data, such as unique identifiers and standard information
sent by a device for personalised ads and content, ad and content measurement,
and audience insights, as well as to develop and improve products.

With your permission we and our partners may use precise geolocation data and
identification through device scanning. You may click to consent to our and our
partners’ processing as described above. Alternatively you may click to refuse
to consent or access more detailed information and change your preferences
before consenting. Please note that some processing of your personal data may
not require your consent, but you have a right to object to such processing.
Your preferences will apply to this website only. You can change your
preferences at any time by returning to this site or visit our privacy policy.

DISAGREEMORE OPTIONSAGREE


 * Articles & Reviews
 * News Archive
 * Forums
 * Premium
 * Categories
 * Computers
 * Display Drivers
 * Graphics Cards
 * Linux Gaming
 * Memory
 * Motherboards
 * Processors
 * Software
 * Storage
 * Operating Systems
 * Peripherals
 * Close

 * 
 * Articles & Reviews
 * News Archive
 * Forums
 * Premium
 * Contact
 * Categories
   Computers Display Drivers Graphics Cards Linux Gaming Memory Motherboards
   Processors Software Storage Operating Systems Peripherals
 * 


GCC VS. CLANG ON THE APPLE M1 UNDER ARCH-BASED ASAHI LINUX

Written by Michael Larabel in Software on 15 April 2022. Page 1 of 1. 10
Comments

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.



Using a 2020 Mac Mini with Apple M1 running Asahi Linux with all Arch Linux
packages at the time, I ran a few dozen different benchmarks looking at how
various open-source C/C++ workloads compare when being built under each
compiler. GCC 11.2 and LLVM Clang 13.0.1 were the current packaged compilers
available on Asahi Linux / Arch and used for this round of testing and the same
CFLAGS/CXXFLAGS across testing -- the only change made during testing was
switching out the compiler being used for building the software under test.



For the vast majority of benchmarks the LLVM Clang vs. GCC performance was quite
close, as we've come to see over the years on various AArch64 single board
computers and server platforms. On the Apple M1 the performance was close and
GCC in good standing. But for some workloads there were significant differences
between the compilers:



The NCNN neural network inference library from Tencent was performing hugely
better when built under the GCC compiler. Across all of the different NCNN
neural network benchmarks, the GCC 11.2 built binary held a commanding lead on
the Apple M1. Meanwhile the LLVM Clang 13.0.1 compiler was performing the best
in some of the Stress-NG synthetic benchmarks, consistently offering better
performance for the Liquid-DSP digital signal processing software, and then for
the many other tests was a mix between the two compilers and usually quite
small.



In total 72 different open-source C/C++ benchmarks were built and benchmarked
under each compiler. GCC 11.2 in this initial Asahi Linux compiler testing saw
GCC 11.2 lead about 58% of the time.



If taking the geometric mean of all 72 benchmarks, GCC 11.2 led by about 13%
over Clang.

That's the quick takeaways while all the individual benchmark results can be
found on this OpenBenchmarking.org result page. As the Linux support on the
Apple M1 matures I'll be back around with more compiler benchmarks especially
with Clang 14.0 having just debuted (though not yet on Asahi/Arch as of testing)
and GCC 12.1 also coming out in a few weeks as well as looking at the
performance difference across various CFLAGS/CXXFLAGS configurations and more.

10 Comments

If you enjoyed this article consider joining Phoronix Premium to view this site
ad-free, multi-page articles on a single page, and other benefits. PayPal or
Stripe tips are also graciously accepted. Thanks for your support.






Related Articles
Linux Schedutil Governor's Quirky Behavior Persists In 2023
Linux Developers Evaluating New "DOITM" Security Mitigation For Latest Intel
CPUs
AMD 4th Gen EPYC "Genoa" To Enjoy Slightly Better Performance With Linux 6.3
Linux 6.3 To Squeeze A Bit More Performance Out Of AMD Zen 4 CPUs
Linux 6.2's Call Depth Tracking Helps Recover Lost Performance On Intel Skylake
CPUs
Linux 6.2 Features: Stable Intel Arc Graphics. RTX 30 Support, Intel On Demand +
IFS Ready
About The Author

Michael Larabel is the principal author of Phoronix.com and founded the site in
2004 with a focus on enriching the Linux hardware experience. Michael has
written more than 20,000 articles covering the state of Linux hardware support,
Linux performance, graphics drivers, and other topics. Michael is also the lead
developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org
automated benchmarking software. He can be followed via Twitter, LinkedIn, or
contacted via MichaelLarabel.com.

Latest Linux News
Linux 6.2, Linux 6.3 Developments, KDE Plasma 5.27 & More Made For An Exciting
Month
Incomplete Fedora 38 Changes Pushed Back, Including Dropping Legacy X.Org
Drivers
NVIDIA 530.30.02 Linux Beta Driver Released
HP Dev One Production Ends For One Of The Most Interesting Linux Developer
Laptops
EXT4 Scores A Nice Direct I/O Performance Improvement With Linux 6.3
FFmpeg 6.0 Released With NVIDIA NVENC AV1, VA-API Improvements
KDE Plasma Development Branch Switches To Qt6-Only
GIMP 2.10.34 Released With JPEG XL Export, Some Backports From GIMP 2.99 Series
Apache OpenOffice 4.1.14 Brings A Handful Of Bug Fixes
Armbian 23.02 ARM/RISC-V OS Released With Linux 6.1 LTS Kernel

Show Your Support, Go Premium

Phoronix Premium allows ad-free access to the site, multi-page articles on a
single page, and other features while supporting this site's continued
operations.

Latest Featured Articles
AMD Ryzen 9 7950X3D Linux Performance
NVIDIA GeForce RTX 4090/4080 Linux Compute CUDA & OpenCL Benchmarks, Blender
Performance
NVIDIA GeForce RTX 4080 / RTX 4090 Linux Performance
TUXEDO OS 2 Being Prepared With Linux 6.0, Updated KDE Desktop & More
Embree 4.0 Is Running Well On Intel 4th Gen Xeon Scalable "Sapphire Rapids"

Support Phoronix

The mission at Phoronix since 2004 has centered around enriching the Linux
hardware experience. In addition to supporting our site through advertisements,
you can help by subscribing to Phoronix Premium. You can also contribute to
Phoronix through a PayPal tip or tip via Stripe.

Phoronix Media

--------------------------------------------------------------------------------

 * Contact
 * Michael Larabel
 * OpenBenchmarking.org

Phoronix Premium

--------------------------------------------------------------------------------

 * Support Phoronix
 * While Having Ad-Free Browsing,
 * Single-Page Article Viewing

Share

--------------------------------------------------------------------------------

 * Facebook
 * Twitter

 * Legal Disclaimer, Privacy Policy, Cookies | Contact

 * Copyright © 2004 - 2023 by Phoronix Media.

 * All trademarks used are properties of their respective owners. All rights
   reserved.