The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning. Learn more β
Top 23 Go Serialization Projects
-
jsoniter
A high-performance 100% compatible drop-in replacement of "encoding/json" (by json-iterator)
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
cbor
CBOR codec (RFC 8949) with CBOR tags, Go struct tags (toarray, keyasint, omitempty), float64/32/16, big.Int, and fuzz tested billions of execs.
-
karmem
Karmem is a fast binary serialization format, faster than Google Flatbuffers and optimized for TinyGo and WASM.
-
go-capnproto
Cap'n Proto library and parser for go. This is go-capnproto-1.0, and does not have rpc. See https://github.com/zombiezen/go-capnproto2 for 2.0 which has rpc and capabilities.
-
bambam
auto-generate capnproto schema from your golang source files. Depends on go-capnproto-1.0 at https://github.com/glycerine/go-capnproto
-
parco
ππ» generalist, fast and tiny binary parser and compiler generator, powered by Go 1.18+ Generics
-
polyglot
A high-performance serialization framework used for encoding and decoding arbitrary datastructures across languages. (by loopholelabs)
-
go-cardano-serialization
Golang library for serialization & deserialization of Cardano data structures.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Since most of the time would be spent decoding json, you could try to cut this time using https://github.com/bytedance/sonic or https://github.com/json-iterator/go, both are drop-in replacements for the stdlib, sonic is faster.
Now letβs take a look at the source code of the protoc-gen-go plugin:
Someone made a benchmark of serialization libraries in go [1], and I was surprised to see gobs is one of the slowest ones, specially for decoding. I suspect part of the reason is that the API doesn't not allow reusing decoders [2]. From my explorations it seems like both JSON [3], message-pack [4] and CBOR [5] are better alternatives.
By the way, in Go there are a like a million JSON encoders because a lot of things in the std library are not really coded for maximum performance but more for easy of usage, it seems. Perhaps this is the right balance for certain things (ex: the http library, see [6]).
There are also a bunch of libraries that allow you to modify a JSON file "in place", without having to fully deserialize into structs (ex: GJSON/SJSON [7] [8]). This sounds very convenient and more efficient that fully de/serializing if we just need to change the data a little.
--
1: https://github.com/alecthomas/go_serialization_benchmarks
2: https://github.com/golang/go/issues/29766#issuecomment-45492...
--
3: https://github.com/goccy/go-json
4: https://github.com/vmihailenco/msgpack
5: https://github.com/fxamacker/cbor
--
6: https://github.com/valyala/fasthttp#faq
--
7: https://github.com/tidwall/gjson
8: https://github.com/tidwall/sjson
Project mention: Sandstorm: Open-source platform for self-hosting web app | news.ycombinator.com | 2023-06-04The Go implementation of capnp is alive and well, too. I highly recommend it: https://github.com/capnproto/go-capnp
Someone made a benchmark of serialization libraries in go [1], and I was surprised to see gobs is one of the slowest ones, specially for decoding. I suspect part of the reason is that the API doesn't not allow reusing decoders [2]. From my explorations it seems like both JSON [3], message-pack [4] and CBOR [5] are better alternatives.
By the way, in Go there are a like a million JSON encoders because a lot of things in the std library are not really coded for maximum performance but more for easy of usage, it seems. Perhaps this is the right balance for certain things (ex: the http library, see [6]).
There are also a bunch of libraries that allow you to modify a JSON file "in place", without having to fully deserialize into structs (ex: GJSON/SJSON [7] [8]). This sounds very convenient and more efficient that fully de/serializing if we just need to change the data a little.
--
1: https://github.com/alecthomas/go_serialization_benchmarks
2: https://github.com/golang/go/issues/29766#issuecomment-45492...
--
3: https://github.com/goccy/go-json
4: https://github.com/vmihailenco/msgpack
5: https://github.com/fxamacker/cbor
--
6: https://github.com/valyala/fasthttp#faq
--
7: https://github.com/tidwall/gjson
8: https://github.com/tidwall/sjson
Project mention: Introducing Tempo: low latency, cross-platform, end-to-end typesafe APIs | /r/programming | 2023-05-021) Go support is right here https://github.com/200sc/bebop
Go Serialization related posts
- Handling high-traffic HTTP requests with JSON payloads
- How do I marshal a JSON array into a map?
- Is there any equivalent to pydantic, serde, etc?
- Rob Pike: Gobs of data (2011)
- A Journey building a fast JSON parser and full JSONPath
- Protoc Plugins with Go
- Struggling to get JSON response data into usable struct
-
A note from our sponsor - WorkOS
workos.com | 27 Apr 2024
Index
What are some of the best open-source Serialization projects in Go? This list will help you:
Project | Stars | |
---|---|---|
1 | jsoniter | 13,076 |
2 | goprotobuf | 9,546 |
3 | mapstructure | 7,665 |
4 | gogoprotobuf | 5,629 |
5 | msgpack | 2,284 |
6 | go-codec | 1,817 |
7 | hprose | 1,256 |
8 | go-capnp | 1,152 |
9 | csvutil | 889 |
10 | cbor | 659 |
11 | karmem | 630 |
12 | go-capnproto | 288 |
13 | watson | 270 |
14 | php_session_decoder | 160 |
15 | structomap | 144 |
16 | binstruct | 89 |
17 | bebop | 67 |
18 | bambam | 65 |
19 | parco | 60 |
20 | polyglot | 37 |
21 | bel | 37 |
22 | go-cardano-serialization | 29 |
23 | fpdecimal | 28 |
Sponsored