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

Pool zstd encoding/decoding #4208

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

zalegrala
Copy link
Contributor

@zalegrala zalegrala commented Oct 18, 2024

What this PR does:

Here we pool the zstd encoders and decoders for better performance when handling the tenant index.

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
Copy link
Contributor Author

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

                    │    main.txt    │           zstdPooling.txt            │
                    │      B/op      │     B/op      vs base                │
IndexUnmarshalPb-16   154.434Ki ± 0%   3.709Ki ± 1%  -97.60% (p=0.000 n=10)

                    │  main.txt   │          zstdPooling.txt           │
                    │  allocs/op  │ allocs/op   vs base                │
IndexUnmarshalPb-16   100.00 ± 0%   59.00 ± 0%  -41.00% (p=0.000 n=10)

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