The Power Of Compile-Time Resources
summary
A tool converts a known JSON schema into generated C++ files (document.hpp, document_impul.hpp, document.cpp) that emit inline constexpr objects so the schema is embedded as compile-time data; a 9.93 MB schema with 155,990 objects becomes static pointers instead of runtime parsing. Result: binary grows 54→65 MB, RAM drops 218→214 MB, heap allocations 3.0M→2.1M, and runtime falls ~10.18s→10.08s. The pipeline uses nlohmann::json, previously used CBOR, and performs compile-time validation via constexpr exceptions.
AI-written summary · about
chapters (14)
- 0:00Introduction to compile-time resources
- 1:31Background and past talks
- 4:21Real-world use case overview
- 6:50JSON to C++ conversion tool
- 13:33Meetup and constexpr discussion
- 20:34What compile-time work looks like
- 23:04JSON schema performance results
- 31:17Compile-time exceptions and validation
- 39:29Embedded device configuration
- 45:27Constexpr-compatible data structures
- 50:42Minimizing compile-time allocations
- 54:20Random number generation at compile time
- 55:42Configuration file formats
- 56:27Q&A and closing remarks
related talks
01h 01mExpressive Compile Time Parsers
01h 18mExpressive Compile-Time Parsers in C++
42mSerialization in C++ has never been easier! But wait, there's more
01h 10m“constexpr ALL the Things!”
36mCompile-time reflection, Serialization and ORM
03mPoetry
45mC++ is a Metacompiler
39mRobotics at Compile Time: Optimizing Robotics Algorithms With C++'s Compile-Time Features
