Practical constexpr
summary
Applies constexpr across a 25k line ChaiScript codebase and reports concrete effects: many indiscriminate changes show 0% change while a few targeted adjustments produce 10% startup improvement and about 8% less compile memory and later reorganizing statics yields up to 20% faster startup; uses GCC 7.2 and std::array/std::lcm, documents fragile stdlib support (string_view, algorithms, std::exchange) and shows pitfalls like magic static costs, inadvertent copies, and compilers that “try too hard” evaluating constexpr at compile time.
AI-written summary · about
chapters (14)
- 0:00Intro
- 1:09Is this a valid constexpr function?
- 5:33Literal Types
- 7:17constexpr intro
- 9:05constexpr context
- 10:52constexpr Tries Harder
- 16:34Basic Application of constexpr How much change in ChaiScript start-up performance did I see?
- 22:40The Mission
- 38:15Modifying for constexpr
- 46:05constexpr Helps You Find Design Flaws
- 50:40constexpr in C++17 - Lambdas
- 53:13Testing constexpr functions
- 54:10Enabling constexpr
- 56:15Jason Turner
related talks
01h 03mUnlocking the value of C++20
01h 30mC++ in Constrained Environments
55mHow bad is meta-programming still today?
06mLightning Talk: Making Friends With CUDA Programmers (please constexpr all the things)
01h 38mC++20: Reaching for the Aims of C++
01h 02mC++20 - My Favorite Code Examples
01h 00mC++20 - the hidden pearls
59mCombining C++17 Features
