mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
* Update go-kit/kit to 0.12.0 to fix spurious debug logs This version of go-kit/kit/log is just a pass-through to go-kit/log. Also updates a number of dependencies, including the following: * github.com/aws/aws-sdk-go from v1.38.68 to v1.40.45 * github.com/go-kit/log from v0.1.0 to v0.2.0 * github.com/json-iterator/go from v1.1.11 to v1.1.12 * github.com/hashicorp/go-hclog from v0.14.0 to v0.16.2 * github.com/klauspost/compress from v1.13.5 to v1.13.6 * golang.org/x/net from ad29c8ab022f to 978cfadd31cf None of these changes looks material to Tempo. After update, ran `go mod tidy -go=1.16 && go mod tidy -go=1.17`. This makes `make vendor-check` pass; I don't think it actually changes what gets linked. * Replace calls to go-kit/kit/log with go-kit/log They are identical - the first is a pass-through to the latter - but the linter generates errors due to go-kit/kit/log being marked deprecated. * Update CHANGELOG * go mod tidy Co-authored-by: Martin Disibio <[email protected]>
2.9 KiB
2.9 KiB
A high-performance 100% compatible drop-in replacement of "encoding/json"
Benchmark
Raw Result (easyjson requires static code generation)
| ns/op | allocation bytes | allocation times | |
|---|---|---|---|
| std decode | 35510 ns/op | 1960 B/op | 99 allocs/op |
| easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op |
| jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op |
| std encode | 2213 ns/op | 712 B/op | 5 allocs/op |
| easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op |
| jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op |
Always benchmark with your own workload. The result depends heavily on the data input.
Usage
100% compatibility with standard lib
Replace
import "encoding/json"
json.Marshal(&data)
with
import jsoniter "github.com/json-iterator/go"
var json = jsoniter.ConfigCompatibleWithStandardLibrary
json.Marshal(&data)
Replace
import "encoding/json"
json.Unmarshal(input, &data)
with
import jsoniter "github.com/json-iterator/go"
var json = jsoniter.ConfigCompatibleWithStandardLibrary
json.Unmarshal(input, &data)
How to get
go get github.com/json-iterator/go
Contribution Welcomed !
Contributors
Report issue or pull request, or email [email protected], or 
