Skip to content

annopnod/MsgPack.Light

 
 

Repository files navigation

MsgPack.Light

MsgPack.Light is a lightweight MsgPack serialization library.

Key features

  • Performance
  • .Net core compatability
  • Extensibility
  • Simple usage

Install

Simpliest way to start using ProGaudi.MsgPack.Light is to install it from NuGet.

Usage

Serialization to bytes array:

var bytes = MsgPackSerializer.Serialize(value);

Deserialization:

var value = MsgPackSerializer.Deserialize<string>(bytes);

Your type serialization/deserialization:

If you want to work with your own types, first thing you need - type converter. Example of Beer type converter you can find here. Then you should create create MsgPackContext and register your converter:

var context= new MsgPackContext();
context.RegisterConverter(new BeerConverter());

And then you can serialize:

var bytes = MsgPackSerializer.Serialize(beer, context);

And deserialize:

var beer = MsgPackSerializer.Deserialize<Beer>(bytes, context);

Build

To build MsgPack.Light you have to install dotnet SDK version 1.0.0-preview4-004233 or higher (you can find corresponding build on dotnet/cli project. After dotnet is installed, run following commands:

git clone https://github.com/progaudi/MsgPack.Light.git
cd MsgPack.Light
dotnet build -c Release -f netstandard1.4 src/msgpack.light/msgpack.light.csproj
dotnet build -c Release -f netcoreapp1.1 tests/msgpack.light.tests/msgpack.light.tests.csproj
dotnet test -c Release --no-build tests/msgpack.light.tests/msgpack.light.tests.csproj

MsgPack.Light should built and all test should be passed.

Performance

  • Serialization performance is comparable with msgpack.cli
  • Deserialization performance 2-3 times faster
  • MsgPack.Light works best if a data reside a memory (_*Array benchmarks).
  • Perfoming some IO operations, performance is suboptimal, but comparable with MsgPack.Cli (*_Stream benchmarks).
  • More details can be found here.

Credits

Roadmap

  • Code-generator for field-based converters, we will support array and map modes.
  • Possible optimizations with IO handling and asyncing our API.

Build statuses for master branch

Linux and OSX build status (it's not possible to separate build status per OS, so if any OS is failing build status will be failing):

Linux and OSX build status

About

Small and fast cross-platform msgpack serializer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%