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

core/hpke: reduce memory usage from zstd #4650

Merged
merged 2 commits into from Oct 31, 2023
Merged

Conversation

calebdoxsey
Copy link
Contributor

@calebdoxsey calebdoxsey commented Oct 30, 2023

Summary

Based on https://pkg.go.dev/tailscale.com/smallzstd we can use a smaller window size and some options to reduce the memory usage for zstd.

Re-using the encoder and decoder appears to be supported based on the packages documentation. The defaults are not a memory leak, but they do use a lot of memory since they are optimized for large payloads.

Related issues

Checklist

  • reference any related issues
  • updated docs
  • updated unit tests
  • updated UPGRADING.md
  • add appropriate tag (improvement / bug / etc)
  • ready for review

@coveralls
Copy link

coveralls commented Oct 30, 2023

Coverage Status

coverage: 63.943%. remained the same when pulling c8defaf on cdoxsey/zstd-memory-leak into 2472490 on main.

pkg/hpke/url.go Outdated Show resolved Hide resolved
@calebdoxsey calebdoxsey merged commit a29476f into main Oct 31, 2023
9 checks passed
@calebdoxsey calebdoxsey deleted the cdoxsey/zstd-memory-leak branch October 31, 2023 16:24
@wasaga wasaga added enhancement New feature or request and removed performance labels Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants