Google Wouter van Oortmerssen Jun 17, 2014

FlatBuffers: Memory-Efficient Serialization

Article Summary

Wouter van Oortmerssen from Google's Fun Propulsion Labs just open-sourced FlatBuffers, a serialization library that reads data without unpacking or allocating extra memory. Game developers struggling with performance overhead, this one's for you.

Google released FlatBuffers as an open-source C++ serialization library specifically designed for game developers. The library stores data in cross-platform buffers that can be accessed in-place without parsing, offering a more efficient alternative to Protocol Buffers or JSON for game data storage.

Key Takeaways

Critical Insight

FlatBuffers eliminates parsing overhead by letting you access serialized data directly in-place, making it faster and more memory-efficient than Protocol Buffers or JSON for game development.

The article reveals how Google's gaming team is using this internally and what specific performance problems it solves that other serialization formats can't.

About This Article

Problem

Game developers needed a way to store and transmit data efficiently across Android, Linux, OSX, and Windows while keeping compatibility as formats changed over time.

Solution

Wouter van Oortmerssen's team at Fun Propulsion Labs created FlatBuffers using C++ with only STL dependencies. The schema compiler generates code for both C++ and Java.

Impact

FlatBuffers doesn't require unpacking or allocating extra memory when accessing data. This gives game developers lower overhead compared to Protocol Buffers or JSON for storing game data.