Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace encoding/json with json-iterator/go in backend #4205

Closed
wants to merge 2 commits into from

Conversation

zalegrala
Copy link
Contributor

@zalegrala zalegrala commented Oct 18, 2024

What this PR does:

To improve the performance of json marshaling/unmarshaling of the tenant index and the block metas, swap out the library in use.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@zalegrala zalegrala changed the title Replace encoding/json with github.com/json-iterator/go in tempodb/bac… Replace encoding/json with github.com/json-iterator/go in backend Oct 18, 2024
@zalegrala zalegrala changed the title Replace encoding/json with github.com/json-iterator/go in backend Replace encoding/json with json-iterator/go in backend Oct 18, 2024
@zalegrala
Copy link
Contributor Author

❯ benchstat main.txt jsonIter.txt
goos: linux
goarch: amd64
pkg: github.com/grafana/tempo/tempodb/backend
cpu: AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
                  │  main.txt   │            jsonIter.txt             │
                  │   sec/op    │   sec/op     vs base                │
IndexUnmarshal-16   57.49µ ± 3%   41.67µ ± 2%  -27.52% (p=0.000 n=10)

                  │   main.txt   │            jsonIter.txt             │
                  │     B/op     │     B/op      vs base               │
IndexUnmarshal-16   55.71Ki ± 0%   53.02Ki ± 0%  -4.82% (p=0.000 n=10)

                  │  main.txt  │            jsonIter.txt             │
                  │ allocs/op  │ allocs/op   vs base                 │
IndexUnmarshal-16   206.0 ± 1%   421.0 ± 0%  +104.37% (p=0.000 n=10)

@zalegrala zalegrala closed this Nov 20, 2024
@zalegrala zalegrala deleted the jsonIter branch November 20, 2024 14:33
@zalegrala zalegrala restored the jsonIter branch November 20, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant