~/talk

The Power and Pain of Hidden Symbols in C++ Programming

Talkat C++ on Sea 2025 · 2025-06-23..06-25· [c-and-cpp, devops-and-delivery]
slides:none on file

Claim: making symbols -fvisibility=hidden by default and exporting only the intended API, then enabling link-time optimization, shrinks and speeds real C++ shared libraries. Tools and tactics: use the GNU visibility attribute (or a small CMake-generated export macro), check with Compiler Explorer, and run LTO/PGO. Concrete result: EnergyPlus builds drop ~6% size and gain ~3% from hidden alone, and combined hidden+LTO yields roughly 14% smaller binary and ~10% faster in the presented case. Pain points: must export dependent types, handle tests, and fix ODR/LTO issues.

AI-written summary · about

  1. 0:00Introduction
  2. 5:44Shared libraries and API
  3. 9:19Symbol inlining and optimization
  4. 14:26Semantic interposition and visibility
  5. 20:04Static, inline, and anonymous rules
  6. 23:18Inline namespaces for ABI
  7. 27:32Cross-platform exports
  8. 31:05Hidden symbols: power and pain
  9. 36:06Link time vs traditional compilation
  10. 40:04Energy Plus case study
  11. 48:06Position independent executables
  12. 49:29ODR violations and LTO
  13. 51:58Constexpr data and LTO tricks
  14. 57:12Summary and CMake guide
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.