A high-performance, no-allocation C++ JSON library for direct parsing to custom data structures with declarative mappings.
JSON Link is a high-performance, header-only C++ library for JSON serialization and parsing that directly maps JSON data to user-defined C++ data structures. It solves the problem of inefficient JSON handling by eliminating intermediate DOM representations and allocations, offering declarative mappings and multiple parsing modes for optimal performance.
C++ developers working on performance-sensitive applications that require efficient JSON parsing and serialization, such as game engines, high-frequency trading systems, or embedded systems.
Developers choose JSON Link for its zero-allocation parsing, direct mapping to custom types, and compile-time optimizations, which together provide superior performance and lower memory overhead compared to traditional JSON libraries.
Fast, convenient JSON serialization and parsing in C++
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The parser avoids memory allocations by directly mapping JSON to user data structures, minimizing overhead and enabling high-speed parsing, as emphasized in the philosophy section.
Supports direct parsing, lazy DOM with json_value, SAX events, and array iterators, allowing developers to choose the optimal approach for different JSON handling tasks, as listed in the key features.
Can generate JSON schemas from mappings and use JSON Path for navigation, facilitating API documentation and precise data extraction without intermediate representations.
Configurable to work without exceptions using custom handlers or termination, making it suitable for embedded systems with -fno-exceptions, as detailed in the error handling section.
Each C++ type requires a specialized json_data_contract trait with explicit member listings, which can be boilerplate-heavy for complex object hierarchies compared to reflection-based libraries.
Does not escape/unescape member names during serialization and ignores trailing commas, as admitted in the limitations, which may cause issues with strict JSON validation.
Inline string literals in C++20 mode have known issues with compilers like g++9.x, reducing portability and requiring careful toolchain selection, as noted in the differences section.