All Pages tagged 'go-codec'
Benchmarks!!! Serialization in Go!!!
Let’s have some fun with some numbers.
In the serialization in go article , we discussed a number of types of encoding formats and their libraries in go.
How go-codec achieves its stellar performance
They say premature optimization is the root of all evil. I say some layers of the stack MUST be optimal. The layer that does marshalling of data MUST be optimal.
go-codec library supports code generation OR runtime reflection for its encoding and decoding. We will mostly discuss the runtime reflection in this article. It is easiest to compare this to other libraries.
go-codec: Primer and How To Guide
go-codec is a high performance and feature rich library that provides idiomatic encoding and decoding support for msgpack, binc, cbor, json and simple formats. It supports both runtime introspection (reflection) and code generation. Below, we will walk you through using it for your serialization needs.
Supported formats:
go-codec supports cbor? What is a CBOR?
Glad you asked. cbor stands for: Concise Binary Object Representation .
cbor is a relatively new binary format which builds upon the simplicity of messagepack and json. It is currently being targeted agressively in the internet-of-things space. It is a kick-ass format.
Serialization In Go
For data transfer between systems to occur, the sending side must encode the data structures into a stream of bytes, and the receiving side must efficiently decode the stream of bytes into a representative data structure.
There is efficient and extensive support for this when using go as your language runtime. The standard library provides support for the following general-purpose encodings: