A high-performance, idiomatic C# implementation of Google's FlatBuffers zero-copy binary serialization format.
FlatSharp is a C# implementation of Google's FlatBuffers, a zero-copy binary serialization format designed for high-performance applications. It allows efficient serialization and deserialization of data with minimal memory overhead, leveraging modern .NET features like `Memory<T>` and `Span<T>` for safe, fast operations. The library solves the need for rapid data access in performance-critical scenarios, such as game development, real-time systems, and large-scale data processing.
C# developers building high-performance applications, particularly in game development (Unity), real-time systems, gRPC services, or any scenario where low-latency data serialization is required. It's also suitable for projects targeting AOT compilation or cross-platform frameworks like Blazor and Xamarin.
Developers choose FlatSharp for its combination of safety, speed, and idiomatic C# design, often outperforming unsafe alternatives. Its zero-copy deserialization, multiple deserialization modes, and strong security practices make it a reliable choice for production environments at companies like Microsoft and Unity3D.
Fast, idiomatic C# implementation of Flatbuffers
Enables direct data access from serialized buffers without parsing overhead, leading to ultra-fast read operations as emphasized in the performance benchmarks.
Benchmarks show FlatSharp outperforms alternatives like Protobuf.NET and Message Pack C# in both serialization and deserialization times, even with safe code.
Avoids unsafe code and IL generation, using bounds checking and fuzz testing to prevent vulnerabilities, ensuring robust production use.
Works with Unity, Blazor, Xamarin, and supports AOT compilation, making it versatile for modern .NET deployments without platform lock-in.
Requires defining FBS schema files and integrating the FlatSharp.Compiler into the build process, adding overhead compared to drop-in serializers.
Changes to the schema necessitate regenerating and recompiling C# code, which can slow iterative development compared to dynamic or reflection-based formats.
The README warns that benchmark gains may not translate to practical scenarios due to cache competition, tempering expectations for some use cases.
Json.NET is a popular high-performance JSON framework for .NET
Protocol Buffers library for idiomatic .NET
MessagePack implementation for Common Language Infrastructure / msgpack.org[C#]
ObjectDumper is a utility which aims to serialize C# objects to string for debugging and logging purposes.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.