Web appOpen in Telegram

PostHow I optimized clang for 1.73x-1.91x performance boost over apt clang

7 October 2026
C
C++ - Reddit
Link
click to show
How I optimized clang for 1.73x-1.91x performance boost over apt clang I wanted to have fast test and release builds, so I decided to "upgrade" my compiler. What I used: Musl Libc LLVM libc overlay Mimalloc Thin LTO PGO Bolt via perf2bolt Optimization flags like: -march -O3 -DNDEBUG -fno-semantic-interposition -fno-plt -fno-pie No exceptions no RTTI I tested the build speed with hyperfine with 2 test cases, one is sqlite.c the other is tu including eigen. |Workload|Build mode|Optimized Clang speedup|Compile-time reduction| |:-|:-|:-|:-| |Eigen, C++23|-O0|1.69×|40.8%| |Eigen, C++23|-O0 -g3 -fno-omit-frame-pointer|1.72×|41.9%| |Eigen, C++23|-O3 -DNDEBUG|1.73×|42.2%| |SQLite amalgamation|-O0|1.74×|42.5%| |SQLite amalgamation|-O0 -g3 -fno-omit-frame-pointer|1.89×|47.1%| |SQLite amalgamation|-O3 -DNDEBUG|1.73×|42.2%| In case anyone is wondering, it also outperformed LLVM release binaries, by about %13 to %15 for each case, but having more performance than the system compiler is more cool so I'm not giving the table for that. It is also very awesome to have a compiler not depend on glibc. If no errors arise, I'll probably never update my compiler for 2 years at least. As my build is portable(no march native just v3) I'm planning on moving to cachyOS or any other optimized linux distro next, to finalise my build enviroment. I'm currently on Ubuntu. https://redd.it/1wb2cq3 @r_cpp
1 · 6 ·

Nearby in the feed

CC++ - RedditBugbusters #1 | C++ in 2026: worth it? | Nathan Baggs https://youtube.com/watch?v=kd-5hJHvKIY&si=shl6xp-4Fwrr7lrZ https://redd.it/1wcdapk @r_cppCC++ - RedditEpisode 411 : CppCast - Kevin Carpenter - Volunteering (and speaking) at C++ conference, and also making sure your credit card payment goes through (or don't) h
this message
CC++ - RedditLatest News From Upcoming C++ Conferences (2026-09-08) **TICKETS AVAILABLE TO PURCHASE** The following conferences currently have tickets available to purchase CC++ - RedditColorado **12th & 13th September** 1. **Advanced and Modern C++ Programming: The Tricky Parts** – Nicolai Josuttis – 2 day in-person workshop available on 12th
CC++ - RedditC++ - Reddit@r_cpp · channel · Tech
229subscribers9average post reach
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog · Search · How we count