Skip to content

quic: Reduce QuicheMemSlice memory footprint from ~968 B to ~120 B - #46724

Open
filipcacky wants to merge 2 commits into
envoyproxy:mainfrom
filipcacky:slice_opt
Open

quic: Reduce QuicheMemSlice memory footprint from ~968 B to ~120 B#46724
filipcacky wants to merge 2 commits into
envoyproxy:mainfrom
filipcacky:slice_opt

Conversation

@filipcacky

Copy link
Copy Markdown
Contributor

Commit Message: quic: Reduce QuicheMemSlice memory footprint from ~968 B to ~120 B
Additional Description:

Change QuicheMemSlice backing storage from Buffer::OwnedImpl to Buffer::SliceDataImpl. This reduces the memory footprint for one slice from ~968 B from the buffer to ~120 B and removes the OwnedImpl ctor from the hot path.

Risk Level: Low
Testing: Added tests for extractImmutableFrontSlice
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Filip Cacky <filip.cacky@cdn77.com>
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #46724 was opened by filipcacky.

see: more, trace.

@filipcacky

Copy link
Copy Markdown
Contributor Author

We noticed QUIC send buffers using more memory than necessary on connections over congested/lossy networks, where slices may need to stay in the buffer for longer periods of time.

In our case some internal filters fragment buffers and end up with many small slices. I don't think this is a significant issue for stock Envoy. In any case this reduces the per-slice overhead and removes the OwnedImpl ctor from the write path.

Also removed the QuicheMemSliceImpl, which isn't required by quiche anymore.

Signed-off-by: Filip Cacky <filip.cacky@cdn77.com>
@filipcacky
filipcacky marked this pull request as ready for review August 16, 2026 19:25
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.

2 participants