<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi Eric,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I just wanted to say a big thanks for doing these. These kinds of concrete comparisons are really useful for the community!<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Synth-diy <synth-diy-bounces@synth-diy.org> on behalf of Eric Brombaugh via Synth-diy <synth-diy@synth-diy.org><br>
<b>Sent:</b> Thursday, May 5, 2022 7:20 AM<br>
<b>To:</b> Synth-diy@synth-diy.org <Synth-diy@synth-diy.org><br>
<b>Subject:</b> [sdiy] GCC vs Clang for Audio DSP</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">In a previous thread we had some exchanges about the performance of
<br>
various compilers used in embedded ARM applications. I've been using GCC <br>
for this over the course of the last decade and had seen some remarkable <br>
improvements in its performance so I was somewhat surprised that it was <br>
viewed as being substantially underperforming in comparison to the <br>
proprietary toolchains based on LLVM/clang.<br>
<br>
I decided to try for myself and put together a quick DSP benchmark <br>
that's representative of the sort of stuff that I often do in my <br>
embedded work. I took some time to create build scripts for clang and <br>
test out both the free and proprietary versions to compare them against <br>
GCC for both execution speed and binary size. the results are <br>
interesting so I summarized them with tables and charts over here:<br>
<br>
<a href="https://github.com/emeb/f303k8_nucleo">https://github.com/emeb/f303k8_nucleo</a><br>
<br>
The quick summary is that based on this one example it appears that <br>
recent builds of GCC are not grossly out of line with the performance of <br>
Clang in both the free and proprietary flavors. For all levels of <br>
optimization greater than -O0 GCC performs roughly as well if not better <br>
than either version of Clang. This test also shows very little <br>
difference between the free and proprietary versions of Clang.<br>
<br>
I would like to emphasize that this is one particular use-case and by no <br>
means representative of the performance you'd see in all applications of <br>
these compilers. It does however provide an alternative viewpoint backed <br>
by hard evidence to the notion that GCC is generally sub-standard and <br>
not for professional use.<br>
<br>
If you have questions about the methodology I used here, the entire <br>
source and build scripts are available at that github repo for your <br>
inspection. I will admit that I'm not a clang power-user so there may be <br>
some optimizations that I've overlooked and I'd appreciate any <br>
suggestions on how to make this analysis more complete.<br>
_______________________________________________<br>
Synth-diy mailing list<br>
Synth-diy@synth-diy.org<br>
<a href="http://synth-diy.org/mailman/listinfo/synth-diy">http://synth-diy.org/mailman/listinfo/synth-diy</a><br>
Selling or trading? Use marketplace@synth-diy.org<br>
</div>
</span></font></div>
</body>
</html>