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. Learn more →
Top 10 Go json-parser Projects
-
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
--
-
jsoniter
A high-performance 100% compatible drop-in replacement of "encoding/json" (by json-iterator)
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.
-
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.
-
Project mention: Introducing astjson: Transform and Merge JSON Objects with Unmatched Speed in Go | dev.to | 2023-11-29
In this article, I will introduce you to a new package called astjson that I have been working on for the last couple of weeks. It is a Go package that allows you to transform and merge JSON objects with unmatched speed. It is based on the jsonparser package by buger aka Leonid Bugaev and extends it with the ability to transform and merge JSON objects at unparalleled performance.
-
-
fastjson
Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection (by valyala)
I’ve used fastjson when unmarshalling to Structs is inconvenient. https://github.com/valyala/fastjson
-
-
-
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.
-
hocon
go implementation of lightbend's HOCON configuration library https://github.com/lightbend/config
-
jsonc
Golang (v1.13+) JSON5 preprocessor supporting comments, trailing comma, unquoted key/single-quoted string, hex number, trailing decimal point, literal newlines and more. (by adhocore)
-
Here's the GitHub repo: https://github.com/biraj21/json-parser
Go json-parser related posts
- Introducing astjson: Transform and Merge JSON Objects with Unmatched Speed in Go
- What's the best way to unmarshall this nested JSON?
- Modification of json string without deserialisation into map/struct
- Object-oriented JSON in Go
- Best approach for a monolithic web app?
- Mapping json fields in api calls to a struct to store them in a database or cache
- Which CPU to buy based on profiling
-
A note from our sponsor - InfluxDB
www.influxdata.com | 18 Apr 2024
Index
What are some of the best open-source json-parser projects in Go? This list will help you:
Project | Stars | |
---|---|---|
1 | GJSON | 13,589 |
2 | jsoniter | 13,048 |
3 | jsonparser | 5,347 |
4 | easyjson | 4,332 |
5 | fastjson | 2,149 |
6 | jstream | 550 |
7 | ajson | 214 |
8 | hocon | 71 |
9 | jsonc | 15 |
10 | json-parser | 5 |