dbolin / Apex.Serialization

High performance contract-less binary serializer for .NET
MIT License
86 stars 13 forks source link

Enable Compression on serialize using Brotli Or ZstdSharp #224

Closed mbtolou closed 6 months ago

mbtolou commented 7 months ago

Greetings and Regards.

I suggested that you add a compressor like Brotli or Zstd or Snappy to your beautiful library. Both of these libraries have the highest compression and decompression speed and are very small in size.

Thanks

https://github.com/oleg-st/ZstdSharp https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.brotlistream?view=net-8.0

C Size ratio% C MB/s D MB/s Name
32823983 32.8 3.40 67.92 lzma 9
32872154 32.8 0.31 315.27 brotli 11d27
32925079 32.9 1.70 70.67 lzturbo 49
33936389 33.9 2.57 1701.35 lzturbo 39
34105370 34.1 3.32 952.59 zstd 22
36751363 36.7 48.30 1701.59 lzturbo 32
36920708 36.7 2.98 2355.32 lzturbo 29
46546059 46.5 163.77 1489.57 lzturbo 31
46805879 46.8 44.66 940.64 zstd 9
48152545 48.1 52.94 349.62 brotli 4
49497505 49.4 2.48 2299.20 lizard 49
49773790 49.7 38.08 1952.73 lzturbo 22
49860700 49.8 16.94 295.99 zlib 9
49962678 49.9 35.70 294.24 zlib 6
50278958 50.2 282.43 1372.91 lzturbo 30
52509931 52.5 290.96 347.16 brotli 1
52549655 52.5 239.35 2153.41 lzturbo 21
52928477 52.9 69.17 276.75 zlib 1
52983490 52.9 393.67 984.00 zstd 1
54251482 54.2 2.60 4367.15 lzturbo 19
54410769 54.4 46.37 3305.22 lz4 9
55923645 55.9 188.40 4200.23 lzturbo 12
57606731 57.6 386.90 3948.64 lzturbo 11
59085723 59.0 698.39 2196.24 lzturbo 20
61455711 61.4 800.71 4003.54 lzturbo 10
61938605 61.9 730.46 3330.40 lz4 1
100098564 100.0 8647.84 8408.10 memcpy