登录 注册

MemoryPack

去点 Star
游戏与娱乐数据分析与数据处理
4,779
Stars
325
Forks
53
Watchers
35
Open Issues
MIT
许可证
C#
语言
2022-09-03
创建时间
2026-11-11
最近更新

项目能做什么

专为 C# 和 Unity 打造的零编码极端性能二进制序列化库。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# MemoryPack

[![NuGet](https://img.shields.io/nuget/v/MemoryPack.svg)](https://www.nuget.org/packages/MemoryPack)
[![GitHub Actions](https://github.com/Cysharp/MemoryPack/workflows/Build-Debug/badge.svg)](https://github.com/Cysharp/MemoryPack/actions)
[![Releases](https://img.shields.io/github/release/Cysharp/MemoryPack.svg)](https://github.com/Cysharp/MemoryPack/releases)

> [!IMPORTANT]
> MemoryPack is a high-performance serialization format for **trusted data only**: data produced and consumed by code you control, over channels you trust. With the recent rise in security issues found through AI-assisted vulnerability discovery, we no longer recommend using MemoryPack where the input can come from an untrusted party, such as public network endpoints or user-supplied files. For those scenarios use [MessagePack for C# v4](https://github.com/MessagePack-CSharp/MessagePack-CSharp/releases/tag/v4.0.0-preview.1), which is designed to be secure by default and now performs has closed much of the performance gap. The features aimed at cross-boundary communication (the TypeScript code generator among them) will be removed in the next MemoryPack release, so please avoid depending on them.

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

![image](https://user-images.githubusercontent.com/46207/200979655-63ed38ae-dad2-4ca0-bbb7-9e0aa98914af.png)

> Compared with [System.Text.Json](https://learn.microsoft.com/ja-jp/dotnet/api/system.text.json), [protobuf-net](https://github.com/protobuf-net/protobuf-net), [MessagePack for C#](https://github.com/neuecc/MessagePack-CSharp), [Orleans.Serialization](https://github.com/dotnet/orleans/). Measured by .NET 7 / Ryzen 9 5950X machine. These serializers have `IBufferWriter<byte>` method, serialized using `ArrayBufferWriter<byte>` and reused to avoid measure buffer copy. 

For standard objects, MemoryPack is x10 faster and x2 ~ x5 faster than other binary serializers. For struct array, MemoryPack is even more powerful, with speeds up to x50 ~ x200 greater than other serializers.

MemoryPack is my 4th serializer, previously I've created well known serializers, ~~[ZeroFormatter](https://github.com/neuecc/ZeroFormatter)~~, ~~[Utf8Json](https://github.com/neuecc/Utf8Json)~~, [MessagePack for C#](https://github.com/neuecc/MessagePack-CSharp). The reason for MemoryPack's speed is due to its C#-specific, C#-optimized binary format and a well tuned implementation based on my past experience. It is also a completely new design utilizing .NET 7 and C# 11 and the Incremental Source Generator (.NET Standard 2.1 (.NET 5, 6) and there is also Unity support).

Other serializers perform many encoding operations such as VarInt encoding, tag, string, etc. MemoryPack format uses a zero-encoding design that copies as much C# memory as possible. Zero-encoding is similar to FlatBuffers, but it doesn't need a special type, MemoryPack's serialization target is POCO.

Other than performance, MemoryPack has these features
阅读完整原文

项目深度分析 AI 生成

游戏服务器专属极速状态快照与回放中间件

产品构想基于 MemoryPack 零编码极致性能特性,开发面向 Unity/C# 服务端的状态快照生成、增量压缩与帧同步回放一体化商业 SDK/组件。
核心功能内存级增量快照生成器、断线重连快速状态恢复、回放文件打包与版本迁移管理、Unity 编辑器调试查看器。
目标用户Unity 独立游戏团队、中小型实时竞技/MMO 游戏开发商。
难度/周期高 · 3 - 6 个月 · 成本:开发机、Unity 专业版授权、多节点压力测试云服务器费用(推测)
收费模式Unity Asset Store 一次性购买授权 + 商业团队源码授权/技术支持费用。
竞争风险官方警告其不适合非信任数据,直接用于客户端网络包存在安全风险,必须限定在受信任或服务端内部环境;版本容错(Version-Tolerant)能力有限导致存档迁移成本高。
依据 已验证事实

.NET 高性能微服务 IPC / 进程间共享内存通信框架

产品构想封装基于 MemoryPack 与 MemoryMappedFiles/命名管道的极速 IPC 通信库,面向高频交易、桌面密集计算等同机多进程通信场景。
核心功能基于 MemoryPack 的跨进程零拷贝消息总线、无锁环形缓冲区队列、C# Source Generator 自动生成 IPC 契约接口。
目标用户.NET 高性能计算、量化交易桌面端、工业控制监控软件开发团队。
难度/周期中等 · 2 - 3 个月 · 成本:极低(纯代码开发与基准测试环境)
收费模式核心开源 + 高级企业特性(监控看板、崩溃隔离恢复、商业保修)按席位/项目订阅制收费。
竞争风险目标受众相对小众,量化与高频领域通常偏好 C++,.NET 市场基数需验证(推测)。
依据 数据支持的判断

高性能序列化与网络层商业咨询与定制优化服务

产品构想依托对 Cysharp 系列高性能工具链(MemoryPack, MessagePack, MagicOnion 等)的深度理解,为出海游戏和高并发 .NET 项目提供性能调优与安全改造咨询。
核心功能网络包/持久化吞吐量审计、从旧序列化器(如 JSON/protobuf)向 MemoryPack/MessagePack v4 迁移方案、跨版本兼容性治理方案。
目标用户正在面临 GC 停顿问题、CPU 序列化开销瓶颈、或需将旧系统改造为安全序列化方案的中大型团队。
难度/周期低 · 按需服务(1-2 周/项目) · 成本:极低,主要为个人时间成本与技术方案编写。
收费模式按人天收费的技术咨询费、性能达标阶梯收费。
竞争风险咨询订单获取高度依赖个人在 C#/.NET 社区的影响力与获客渠道,难以规模化复利(推测)。
依据 已验证事实
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

相似项目数据正在完善中,暂不展示(避免误导)

项目优势与风险

技术成熟度创建于 2022-09-03,近 30 天仍在推送,发布过 71 个 Release
社区活跃Star 4,779 / Fork 325 / Issue 35(数据支持,可自行核实)
许可证MIT
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。