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

perf: consider in-place en- and decryption #2246

Open
mxinden opened this issue Nov 24, 2024 · 0 comments
Open

perf: consider in-place en- and decryption #2246

mxinden opened this issue Nov 24, 2024 · 0 comments

Comments

@mxinden
Copy link
Collaborator

mxinden commented Nov 24, 2024

We currently re-allocate when en- and decrypting:

let size = body.len() + MAX_AUTH_TAG;
let mut out = vec![0; size];

let mut out = vec![0; body.len()];

Now that we tackled various low-hanging fruits around memory allocation (e.g. #2184), memory allocations when en-/decrypting become more prominent. See e.g. the following recent Firefox profile doing a large file transfer:

https://profiler.firefox.com/public/y1ck0xgt3102jyqjjp93ggda99dt8bz2yg5c7k8/flame-graph/?globalTrackOrder=01&thread=1&transforms=ff-72~ff-82~ff-83&v=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

No branches or pull requests

1 participant