sonic VS json

Compare sonic vs json and see what are their differences.

sonic

A blazingly fast JSON serializing & deserializing library (by bytedance)

json

Experimental implementation of a proposed v2 encoding/json package (by go-json-experiment)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
sonic json
22 2
6,225 308
2.3% -
8.1 7.0
10 days ago 11 days ago
Assembly Go
Apache License 2.0 BSD 3-clause "New" or "Revised" License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

sonic

Posts with mentions or reviews of sonic. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-07.

json

Posts with mentions or reviews of json. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-08-13.
  • Rust vs. Go in 2023
    9 projects | news.ycombinator.com | 13 Aug 2023
    https://github.com/BurntSushi/rebar#summary-of-search-time-b...

    Further, Go refusing to have macros means that many libraries use reflection instead, which often makes those parts of the Go program perform no better than Python and in some cases worse. Rust can just generate all of that at compile time with macros, and optimize them with LLVM like any other code. Some Go libraries go to enormous lengths to reduce reflection overhead, but that's hard to justify for most things, and hard to maintain even once done. The legendary https://github.com/segmentio/encoding seems to be abandoned now and progress on Go JSON in general seems to have died with https://github.com/go-json-experiment/json .

    Many people claiming their projects are IO-bound are just assuming that's the case because most of the time is spent in their input reader. If they actually measured they'd see it's not even saturating a 100Mbps link, let alone 1-100Gbps, so by definition it is not IO-bound. Even if they didn't need more throughput than that, they still could have put those cycles to better use or at worst saved energy. Isn't that what people like to say about Go vs Python, that Go saves energy? Sure, but it still burns a lot more energy than it would if it had macros.

    Rust can use state-of-the-art memory allocators like mimalloc, while Go is still stuck on an old fork of tcmalloc, and not just tcmalloc in its original C, but transpiled to Go so it optimizes much less than LLVM would optimize it. (Many people benchmarking them forget to even try substitute allocators in Rust, so they're actually underestimating just how much faster Rust is)

    Finally, even Go Generics have failed to improve performance, and in many cases can make it unimaginably worse through -- I kid you not -- global lock contention hidden behind innocent type assertion syntax: https://planetscale.com/blog/generics-can-make-your-go-code-...

    It's not even close. There are many reasons Go is a lot slower than Rust and many of them are likely to remain forever. Most of them have not seen meaningful progress in a decade or more. The GC has improved, which is great, but that's not even a factor on the Rust side.

  • Toward the Fastest, Compatible JSON Decoder - Sonnet
    3 projects | /r/golang | 11 Feb 2023
    Add https://github.com/go-json-experiment/json

What are some alternatives?

When comparing sonic and json you can also consider the following projects:

jsoniter - Using encoding/json to load parts of a large json document

fastjson - Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection

encoding - Go package containing implementations of efficient encoding, decoding, and validation APIs.

simdjson - Parsing gigabytes of JSON per second : used by Facebook/Meta Velox, the Node.js runtime, ClickHouse, WatermelonDB, Apache Doris, Milvus, StarRocks

simdjson-go - Golang port of simdjson: parsing gigabytes of JSON per second

json-iterator - Low level iterator on the records inside large JSON file.

sonnet - High performance JSON decoder in Go

avo - Generate x86 Assembly with Go

haxmap - Fastest and most memory efficient golang concurrent hashmap

hashmap - A Golang lock-free thread-safe HashMap optimized for fastest read access.

xxHash - Pure Go implementation of xxHash (32 and 64 bits versions)

xxhash - A Go implementation of the 64-bit xxHash algorithm (XXH64)