中文 | Quick Start | Support Types
Xfrogcn BinaryFormatter is a high performance binary serialization libraries in .NET, it through the Span and Emit to achieve high performance, BinarySerializer uses an API interface that is consistent with System.Text.JSON, so easy to use.
Compare with the .NET built-in binaryFormatter serializer (Runtime.Serialization.Formatters.Binary), this library performance can be more than 4 times, and the size of the Serialization results only 75% of it.
The following by test/BinaryFormatter Benchmark
performance test project to obtain performance data, including:
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.18363.1237 (1909/November2018Update/19H2)
Intel Core i7-7500U CPU 2.70GHz (Kaby Lake), 1 CPU, 4 logical and 2 physical cores
.NET Core SDK=5.0.101
[Host] : .NET Core 3.1.10 (CoreCLR 4.700.20.51601, CoreFX 4.700.20.51901), X64 RyuJIT
DefaultJob : .NET Core 3.1.10 (CoreCLR 4.700.20.51601, CoreFX 4.700.20.51901), X64 RyuJIT
Method | Categories | Mean | Error | StdDev |
---|---|---|---|---|
Json | Stream | 61.41 μs | 1.212 μs | 2.154 μs |
XfrogcnBinary |
Stream | 92.97 μs | 1.691 μs | 2.425 μs |
SystemBinaryFormatter | Stream | 291.37 μs | 5.729 μs | 11.174 μs |
Json_Bytes | Bytes | 59.79 μs | 1.160 μs | 1.907 μs |
XfrogcnBinary_Bytes |
Bytes | 88.67 μs | 1.437 μs | 1.274 μs |
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.18363.1237 (1909/November2018Update/19H2)
Intel Core i7-7500U CPU 2.70GHz (Kaby Lake), 1 CPU, 4 logical and 2 physical cores
.NET Core SDK=5.0.101
[Host] : .NET Core 3.1.10 (CoreCLR 4.700.20.51601, CoreFX 4.700.20.51901), X64 RyuJIT
DefaultJob : .NET Core 3.1.10 (CoreCLR 4.700.20.51601, CoreFX 4.700.20.51901), X64 RyuJIT
Method | Mean | Error | StdDev |
---|---|---|---|
Json | 100.12 μs | 1.933 μs | 2.374 μs |
XfrogcnBinary |
96.34 μs | 1.631 μs | 1.362 μs |
SystemBinaryFormatter | 334.68 μs | 2.319 μs | 1.936 μs |
Json_Bytes | 80.13 μs | 1.572 μs | 1.989 μs |
XfrogcnBinary_Bytes |
92.14 μs | 1.814 μs | 3.623 μs |
If the serialization type in dynamically loaded assembly, encapsulating and serialization methods in the dynamic loading assemblies, .NET official BinaryFormatter serialization libraries cannot deserialize, will trigger a assembly errors cannot be found.
This serialization libraries have solve this problem
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。