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 · 2 comments · May be fixed by #2385
Open

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

mxinden opened this issue Nov 24, 2024 · 2 comments · May be fixed by #2385

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

@mansf-osk
Copy link
Collaborator

I took a brief look just now and would be interested to dig further when I get back from vacation in February. Maybe we can have a chat then 🙂

larseggert added a commit to larseggert/neqo that referenced this issue Jan 23, 2025
Only in-place encryption so far, and only for the main data path.

Fixes mozilla#2246 (eventually)
@larseggert larseggert linked a pull request Jan 23, 2025 that will close this issue
@larseggert
Copy link
Collaborator

I actually started on this a few days ago. See PR.

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 a pull request may close this issue.

3 participants