什么是C#的最快的序列化机制? [英] What's the fastest Serialization mechanism for c#?
问题描述
这为小型有效载荷。
我期待达到10亿每100毫秒。
I am looking to achieve 1,000,000,000 per 100ms.
标准的BinaryFormatter是很慢的。 DataContractSerializer的比BinaryFormatter的慢。
The standard BinaryFormatter is very slow. The DataContractSerializer is slow than BinaryFormatter.
协议缓冲区(的 http://code.google.com/p/protobuf-net/ )的小物体似乎比BinaryFormatter的慢!
Protocol buffers (http://code.google.com/p/protobuf-net/) seems slower than the BinaryFormatter for small objects!
是否有一个应该寻找在任铁杆编码或开源项目更多的序列化机制
Are there any more Serialization mechanisms a should be looking at either hardcore coding or open source projects?
编辑:
我IN-序列内存中,然后发送一个异步套接字通过TCP有效载荷。在内存中生成的有效载荷小双阵列(10〜500分)与ULONG标识符。
I am serializing in-memory then transmitting the payload over tcp on a async socket. The payloads generated in memory and are small double arrays (10 to 500 points) with a ulong identifier.
推荐答案
您的性能要求限制0可用的序列化自定义的BinaryWriter和BinaryReader会是你能得到最快的。
Your performance requirement restricts the available serializers to 0. A custom BinaryWriter and BinaryReader would be the fastest you could get.
这篇关于什么是C#的最快的序列化机制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!