Blog Logo
TAGS

How to Make the Fastest .NET Serializer with .NET 7 / C# 11, Case of MemoryPack

In this article, Yoshifumi Kawai explains how to create a fast and practical serializer with the release of MemoryPack. MemoryPack is a new C#-specific serializer that performs much faster than other serializers, including MessagePack for C#. It also supports Polymorphism(Union), full version-tolerant, circular references, and the latest modern I/O APIs (IBufferWriter, ReadOnlySeqeunce, Pipelines). Yoshifumi Kawai shares his deep understanding of the performance characteristics of different formats as he has been involved in the creation of the RPC framework MagicOnion, the in-memory database MasterMemory, PubSub client AlterNats, and both client (Unity)/server implementations of several game titles. The biggest advantage of the Source Generator is that it is AOT-friendly, which makes it possible to work safely with Unitys IL2CPP, and the initial start-up speed is also fast. MemoryPacks goal is to be the ultimate fast, practical and versatile serializer, and Yoshifumi Kawai believes he has achieved it.