Create a gist now

Instantly share code, notes, and snippets.

Benchmark result of ZeroFormatter - https://github.com/neuecc/ZeroFormatter/
Warming-up
ZeroFormatter
ZeroFormatter
protobuf-net
protobuf-net
MsgPack-CLI
MsgPack-CLI
JSON.NET
JSON.NET
Jil
Jil
FsPickler
FsPickler
BinaryFormatter
BinaryFormatter
DataContractSerializer
DataContractSerializer
FlatBuffers
FlatBuffers
Google.Protobuf
Google.Protobuf
Small Object(int,string,string,enum) 10000 Iteration
ZeroFormatter
Serialize 1.9464 ms
Deserialize 1.4629 ms
ReSerialize 0.4864 ms
Binary Size 50.00 B
protobuf-net
Serialize 3.7141 ms
Deserialize 6.4054 ms
ReSerialize 3.5395 ms
Binary Size 23.00 B
MsgPack-CLI
Serialize 4.9225 ms
Deserialize 10.7559 ms
ReSerialize 4.6804 ms
Binary Size 26.00 B
JSON.NET
Serialize 18.407 ms
Deserialize 27.2093 ms
ReSerialize 19.894 ms
Binary Size 66.00 B
Jil
Serialize 7.1646 ms
Deserialize 10.5783 ms
ReSerialize 10.0158 ms
Binary Size 71.00 B
FsPickler
Serialize 11.599 ms
Deserialize 10.1129 ms
ReSerialize 9.535 ms
Binary Size 44.00 B
BinaryFormatter
Serialize 55.2341 ms
Deserialize 77.9727 ms
ReSerialize 60.2065 ms
Binary Size 285.00 B
DataContractSerializer
Serialize 17.042 ms
Deserialize 55.7521 ms
ReSerialize 16.6372 ms
Binary Size 206.00 B
FlatBuffers
Serialize 7.6673 ms
Deserialize 0.3806 ms
ReSerialize 0.2569 ms
Binary Size 60.00 B
Google.Protobuf
Serialize 5.5722 ms
Deserialize 1.4329 ms
ReSerialize 3.2781 ms
Binary Size 23.00 B
Large Array(SmallObject[1000]) 10000 Iteration
ZeroFormatter
Serialize 1300.8573 ms
Deserialize 0.9906 ms
ReSerialize 37.2257 ms
Binary Size 52.74 KB
protobuf-net
Serialize 3973.2537 ms
Deserialize 5833.9626 ms
ReSerialize 4156.3625 ms
Binary Size 23.44 KB
MsgPack-CLI
Serialize 4029.0478 ms
Deserialize 13066.9199 ms
ReSerialize 4339.8276 ms
Binary Size 25.39 KB
JSON.NET
Serialize 12532.7125 ms
Deserialize 21034.3625 ms
ReSerialize 11866.5374 ms
Binary Size 61.53 KB
Jil
Serialize 4867.6942 ms
Deserialize 7765.3492 ms
ReSerialize 5037.202 ms
Binary Size 68.36 KB
FsPickler
Serialize 4566.433 ms
Deserialize 4170.2775 ms
ReSerialize 4344.7391 ms
Binary Size 25.53 KB
BinaryFormatter
Serialize 28839.8167 ms
Deserialize 32132.0416 ms
ReSerialize 29271.5081 ms
Binary Size 37.38 KB
DataContractSerializer
Serialize 9880.7343 ms
Deserialize 27245.8843 ms
ReSerialize 9757.2344 ms
Binary Size 103.64 KB
FlatBuffers
Serialize 3481.3145 ms
Deserialize 0.2962 ms
ReSerialize 34.9268 ms
Binary Size 46.91 KB
Google.Protobuf
Serialize 1387.556 ms
Deserialize 2782.2482 ms
ReSerialize 1338.8475 ms
Binary Size 23.44 KB
@neuecc
Owner
neuecc commented Nov 7, 2016

iPhone 6s Plus

image

@neuecc
Owner
neuecc commented Nov 9, 2016 edited
Additional Benchmarks

Int32(1) 10000 Iteration

ZeroFormatter
      Serialize   0.1397 ms
    Deserialize   0.0633 ms
    ReSerialize   0.1264 ms
    Binary Size   4.00 B

MsgPack-CLI
      Serialize   1.3244 ms
    Deserialize   1.1784 ms
    ReSerialize   1.188 ms
    Binary Size   1.00 B

protobuf-net
      Serialize   9.3917 ms
    Deserialize   7.9837 ms
    ReSerialize   8.1901 ms
    Binary Size   2.00 B

Vector3(float, float, float) 10000 Iteration

ZeroFormatter
      Serialize   0.3581 ms
    Deserialize   0.1478 ms
    ReSerialize   0.365 ms
    Binary Size   12.00 B

MsgPack-CLI
      Serialize   3.1468 ms
    Deserialize   4.5674 ms
    ReSerialize   3.1251 ms
    Binary Size   17.00 B

protobuf-net
      Serialize   2.7396 ms
    Deserialize   3.7095 ms
    ReSerialize   2.6483 ms
    Binary Size   15.00 B

HtmlString(307286bytes) 10000 Iteration

ZeroFormatter
      Serialize   4332.4904 ms
    Deserialize   3584.1006 ms
    ReSerialize   4307.5319 ms
    Binary Size   300.09 KB

MsgPack-CLI
      Serialize   6282.16 ms
    Deserialize   4590.0213 ms
    ReSerialize   6429.9141 ms
    Binary Size   300.09 KB

protobuf-net
      Serialize   5395.1408 ms
    Deserialize   8662.9995 ms
    ReSerialize   5375.0662 ms
    Binary Size   300.09 KB

Vector3[100] 10000 Iteration

ZeroFormatter
      Serialize   21.6767 ms
    Deserialize   0.8878 ms
    ReSerialize   1.2878 ms
    Binary Size   1.18 KB

MsgPack-CLI
      Serialize   172.9294 ms
    Deserialize   584.7917 ms
    ReSerialize   180.0802 ms
    Binary Size   1.66 KB

protobuf-net
      Serialize   774.2433 ms
    Deserialize   759.8938 ms
    ReSerialize   780.4323 ms
    Binary Size   1.66 KB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment