A Faster Serialization Library Based on Compile-time Reflection and C++ 20 - Yu Qi - CppCon 2022

Structpack, a blazing-fast serialization library using compile-time reflection and C++20, offers efficient binary serialization without compromising type safety and ease of use.

Key takeaways
  • Structpack is a fast serialization library based on compile-time reflection and C++20.
  • It utilizes compile-time reflection to generate a unique type ID for each object, which is used for type checking and serialization.
  • Structpack doesn’t save extra type information, making the binary size smaller and serialization/deserialization more efficient.
  • It supports trivial copy objects and memory-continuous containers for further optimization.
  • Structpack is easy to use, requiring only one line of code for serialization or deserialization.
  • It is much faster than other classic serialization libraries like Protobuffer, MsgPack, or Boost Serialization.
  • Structpack is non-intrusive, meaning it doesn’t require any macros or modifications to the object being serialized.
  • It provides a clean and simple API for serialization and deserialization.
  • Structpack is still under development but will be open-source soon.
  • The benchmark results show that Structpack is significantly faster than other serialization libraries, especially for complex objects.