Another MessagePack encoding/decoding library.
This library doesn't use reflection, instead it relies on small interface: Map, Array, and Extension.
Heavily inspired by GoJay.
- Encoding primitive types, arrays, maps, and
time.Time
. - No reflection.
- Extension interface for custom types.
- JSON conversion: FromJSON, ToJSON.
- NotOptimizedYet™ - json-related functions are slow at this time.
go get -u github.com/ybkimm/msgpack
Testing PC spec:
- AMD Ryzen 5 2400G (3.90 GHz, 4 Cores, 8 Threads)
- 8GB RAM (Samsung DDR4)
- Windows 10 Pro Build 18362.418
- WSL
BenchmarkDecoder_decodeMap-8 5990668 194 ns/op 64 B/op 1 allocs/op
BenchmarkDecoder_decodeArray-8 2336313 512 ns/op 320 B/op 2 allocs/op
BenchmarkEncoder_encodeMap-8 3324308 362 ns/op 640 B/op 3 allocs/op
BenchmarkEncoder_encodeArray-8 2410296 492 ns/op 592 B/op 2 allocs/op
For benchmark data, see msgpack_test.go.
- Optimize JSON conversion
- 100% coverage
- New benchmark data
- Examples
MIT License. See License.
Some code snippets are comes from gojay - See it's license.