TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How does Clang 2.7 hold up in 2021?

163 pointsby tbodtover 4 years ago

9 comments

kevmo314over 4 years ago
&gt; It is possible in theory that code that&#x27;s less carefully optimized exhibits different behavior, or that the benchmarks chosen here are simply not as amenable to compiler optimization as they could be<p>This seems like a rather important point that&#x27;s glossed over. Typical code is not often as optimized and meticulously written. It would be nice to see how much compilers have improved there.
评论 #25978189 未加载
评论 #25977098 未加载
评论 #25977093 未加载
评论 #25978491 未加载
chalstover 4 years ago
I&#x27;m not all that surprised by the small improvement on regular C++ code: the last decade hasn&#x27;t seen radical changes in how this is done; compiler innovation has been elsewhere with only the SIMD story seen in this article. I was surprised by the lousy build times, though.<p>The choice of WSL2 as platform introduces a few confounders, especially filesystem performance, which might distort the differences between build times in particular. If someone wants to get a better understanding of what&#x27;s going on, maybe a breakdown of where the time is spent or performing the benchmarks on other platforms would be a good idea.
einpoklumover 4 years ago
It&#x27;s not clear that the author of that post used `-march=native -mtune=native`. And if they didn&#x27;t, that could account for the odd results.
评论 #25978109 未加载
评论 #25978243 未加载
uepover 4 years ago
I have a simple C++ raytracer I wrote by going through Ray Tracing in One Weekend. I have not even made an attempt to optimize it. I really only made it parallel by splitting it up into tiles.<p>Clang 10 was able to automatically vectorize the code, so it performs &gt;2x as fast as GCC 8.3. To be fair to GCC, I&#x27;m using my distro&#x27;s GCC, but I built a newer Clang for C++ coroutine support.
评论 #25980589 未加载
vendiddyover 4 years ago
Are bigger optimizations to be hard in the design of the higher level languages that are easier for compilers to optimize?<p>As an extreme example, I imagine dynamic languages are hard to optimize because the compiler can make few assumptions about the code.<p>(Have little knowledge of compilers so correct me if I&#x27;m wrong.)
评论 #25984458 未加载
FartyMcFarterover 4 years ago
I would expect Proebsting&#x27;s law to hit a wall faster than Moore&#x27;s law, simply because software performance is better understood than physics.<p>Perhaps someone could compare FORTRAN compilers to get a longer term view.
评论 #25981162 未加载
KirillPanovover 4 years ago
&gt; This takes me back to &quot;The death of optimizing compilers&quot; by David J. Bernstein<p>DJB is <i>Daniel</i> J. Bernstein
person_of_colorover 4 years ago
Does anyone have a good resource&#x2F;book on how to do close to the metal benchmarking?
评论 #25979770 未加载
评论 #25979565 未加载
person_of_colorover 4 years ago
Wow, 10 years for only 15%.
评论 #25978541 未加载