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

Merged
merged 3 commits into from
Oct 21, 2024
Merged

Pool zstd encoding/decoding #4208

merged 3 commits into from
Oct 21, 2024

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)

Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelog!

amazing benches. should be a good one

@javiermolinar
Copy link
Contributor

awesome!

@zalegrala zalegrala merged commit 67fad67 into grafana:main Oct 21, 2024
16 checks passed
@zalegrala zalegrala deleted the zstdPooling branch October 21, 2024 14:17
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.

3 participants