c# - 使用 BinaryFormatter 而不是 protobuf-net 的原因

标签 c# performance serialization protobuf-net binaryformatter

所以在我见过的许多基准测试中,protobuf-net 远远领先于 BinaryFormatter: - http://theburningmonk.com/2011/08/performance-test-binaryformatter-vs-protobuf-net/ - https://code.google.com/p/protobuf-net/wiki/Performance

这让我想到了一个问题:如果 protobuf-net 可用,您为什么要使用 BinaryFormatter?

我读过一些关于 BinaryFormatter 存储类型元数据的内容,这是 protobuf 不会做的。你能给我一个我想要存储类型元数据的示例场景吗?

最佳答案

我目前正在努力使用 protobuf-net 来序列化 Dictionary<string, object> 类型的对象.我读到的是这是不可能的,所以我想在这种情况下人们更喜欢 BinaryFormatter。

关于c# - 使用 BinaryFormatter 而不是 protobuf-net 的原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29355149/

相关文章:

c# - 接收 : how to pass the latest value from observable into ReactiveCommand

c# - 是否可以通过 Visual Studio Code 创建 Windows 服务?

c# - 从 Windows 文件资源管理器拖放到 Windows 窗体上不起作用

c# - 调试/检查 XML 序列化的工具

Linux 的 C++ 对象序列化

c# - 必须有一个公共(public)的无参数构造函数,不是吗?

r - 计算向量中不同值的数量

sql - 将列的值与该列的平均值进行比较 SQL

c# - 比较 C# 中的 Sum 方法

database - 输入流不是有效的二进制格式。