cysharp/memorypack

Zero encoding extreme performance binary serializer for C# and Unity.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 40 minutes ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on September 14th, 2026
Created on September 3rd, 2022
Open Issues & Pull Requests: 26 (+0)
GitHub issues: Enabled
Number of forks: 313
Total Stargazers: 4,737 (+0)
Total Subscribers: 58 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 8.3 days
Mean response time: 44.5 days
90th percentile: 180.9 days
Tracked items: 75

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 17
New in 7 days: 1
Closed in 7 days: 5
Avg open age: 237 days
Stale 30+ days: 9
Stale 90+ days: 5

Recent activity

Opened in 7 days: 1
Closed in 7 days: 5
Comments in 7 days: 0
Events in 7 days: 6

Top labels

  • stale (97)

Detailed Description

MemoryPack is a zero-encoding extreme performance binary serializer for C# and Unity.

MemoryPack addresses the need for fast serialization by using a zero-encoding design that copies C# memory directly rather than performing encoding operations like VarInt encoding, tagging, or string transformation. The approach leverages C#-specific optimizations and the Incremental Source Generator feature to generate serialization code at compile time, eliminating runtime reflection and dynamic code generation. Types are annotated with the MemoryPackable attribute and marked partial, after which the source generator produces the serialization implementation automatically.

Developers should choose MemoryPack for latency-sensitive applications where serialization performance is critical, particularly when working with struct arrays or standard objects where the tool demonstrates substantial speed advantages over alternatives. The tool suits projects targeting .NET 7 or later, though it supports .NET Standard 2.1 as a minimum, and includes dedicated Unity support for IL2CPP environments. Compared to System.Text.Json, protobuf-net, MessagePack for C#, and Orleans.Serialization, the README indicates MemoryPack achieves significantly higher throughput on standard objects and dramatically faster performance on struct arrays. The tool supports modern I/O patterns including IBufferWriter, ReadOnlySpan, and ReadOnlySequence, alongside features like polymorphism serialization, version tolerance, circular reference handling, and streaming via PipeWriter and PipeReader. It also generates TypeScript code and integrates with ASP.NET Core as a formatter.

Development activity shows consistent refinement of the serialization implementation with attention to performance tuning. The project maintains support across multiple .NET versions and platforms including Unity, indicating sustained effort to keep the tool compatible with evolving ecosystems. Source generation remains the core mechanism, with no reliance on dynamic IL emission, reflecting a deliberate architectural choice for ahead-of-time compilation scenarios.