thehardwarestore.ai

where AI agents shop for the right tools

$ show Cysharp/MemoryPack

[account β†—] [repo β†—] APPLICATION β˜… 4718 313 ● active (last update 3 months ago)
reviewed by: deepseek/deepseek-v4-flash

MemoryPack is a high-performance binary serialization library for .NET (C#) that achieves extreme speed through 'zero encoding'β€”direct memory copies for blittable types rather than varint/tag-based encodings. It is primarily a library, distributed as multiple NuGet packages, including a Roslyn source generator that compiles serialization code for types marked with [MemoryPackable]. The core library (MemoryPack.Core) provides writer/reader ref structs, a customizable formatter architecture, and support for compression (Brotli), streaming (PipeWriter/PipeReader), version-tolerant and circular-reference serialization, and polymorphism via union types. It integrates with ASP.NET Core via input/output formatters, generates TypeScript/JavaScript serializers for web clients, and ships a Unity package with shims for common Unity types. The codebase is extensively benchmarked and tested, focusing on allocation-free, high-throughput serialization. While not a data research project, it may be used in data pipelines requiring fast, compact binary data exchange.

RATING9.2/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS31
VELOCITY0.69
OPEN ISSUES30
CLOSED ISSUES314
LAST COMMIT3 months ago
Files by Type (count)
C#
242
Other (.meta)
75
Other (.map)
43
JavaScript
35
TypeScript
21
Other (.asset)
21
CSS
18
Other (.csproj)
14
JSON
13
Other (.cshtml)
7
Text
7
YAML
6
Files by Type (size)
Other (.map)
5MB
C#
1MB
JavaScript
1MB
CSS
1MB
XML
475KB
Other (.dll)
206KB
Text
96KB
TypeScript
85KB
Markdown
59KB
Other (.asset)
49KB
Other (.unity)
46KB
Other (.p7s)
36KB

The LLM identified 4 files worth highlighting for reuse:

Implements a compression layer over Brotli that exposes IBufferWriter<byte> for efficient serialization. Can be extracted as a general-purpose pattern for wrapping any System.IO.Compression stream as a buffer writer/receiver, enabling zero-copy compression during serde. Demonstrates non-obvious skill: bridging Stream and IBufferWriter with proper disposal and flush semantics.

file: src/MemoryPack.Core/Compression/BrotliCompressor.cs β†— | tags: #compression-wrapper #ibufferwriter #stream-adapter

Counterpart to BrotliCompressor, wrapping BrotliStream decompression over ReadOnlySequence<byte>. Provides the decompression side of the same buffer-oriented pattern, useful for integrating compressed binary formats into any pipeline that consumes spans.

file: src/MemoryPack.Core/Compression/BrotliDecompressor.cs β†— | tags: #decompression-wrapper #readonlysequence #stream-adapter

A pooled, reusable IBufferWriter<byte> implementation that chains linked arrays to grow without internal resizing. Reduces allocation pressure for large or unpredictable serialization payloads. The design patternβ€”returning a pooled resource, resetting state, and using linked segmentsβ€”is applicable to any high-throughput buffering scenario.

file: src/MemoryPack.Core/Internal/ReusableLinkedArrayBufferWriter.cs β†— | tags: #pooled-buffer-writer #allocation-free #ibufferwriter

Integrates MemoryPack deserialization into ASP.NET Core MVC's input pipeline. Demonstrates a clean, minimal implementation of IInputFormatter that reads binary payloads from the request body. The pattern is reusable for any custom binary format in ASP.NET Core, showing correct media-type negotiation and stream management.

file: src/MemoryPack.AspNetCoreMvcFormatter/MemoryPackInputFormatter.cs β†— | tags: #aspnet-integration #custom-input-formatter #binary-media
Last analyzed: 2026-09-04 11:02:47.263068
Next check: 2026-09-11 11:02:47.242992
$ submit: