Skip to content

feat: preserve receive capacity when guests retain zero-copy buffers - #2109

Draft
andreiltd wants to merge 1 commit into
tandr/streams/return-tuplesfrom
tandr/streams/zero-copy
Draft

andreiltd wants to merge 1 commit into
tandr/streams/return-tuplesfrom
tandr/streams/zero-copy

Conversation

@andreiltd

Copy link
Copy Markdown
Member

Stack created with GitHub Stacks CLI • Give Feedback 💬

@andreiltd
andreiltd added this pull request to stack #2110 November 25, 2026 17:58
@andreiltd andreiltd changed the title tandr/streams/zero copy feat: preserve receive capacity when guests retain zero-copy buffers Nov 25, 2026
@andreiltd andreiltd added the C-enhancement For PRs adding features, improving functionality, docs, tests, etc. label Nov 25, 2026
@hyperlight-gh-bot

This comment has been minimized.

Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
@andreiltd
andreiltd force-pushed the tandr/streams/zero-copy branch from cdd1c4c to ff6ceb2 Compare November 26, 2026 13:35
@hyperlight-gh-bot

Copy link
Copy Markdown

Benchmark Results

Measured commit: ff6ceb2f6fd1
Baseline commit: e672ceee7227

kvm / amd (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 268.65 ns (➖ 1.03x faster)
vec_bytes 73.00 ns (➖ 1.00x slower)
372.78 µs (➖ 1.00x slower)

payload_allocation

slot_pool_segmented
65536 147.88 ns (➖ 1.05x slower)
262144 547.28 ns (➖ 1.05x slower)

sandboxes

create_initialized_and_drop
medium 14.47 ms (➖ 1.02x faster)

slot_pool

alloc_dealloc_4096 alloc_dealloc_1500 alloc_dealloc_128
8.10 ns (➖ 1.05x slower) 8.07 ns (➖ 1.02x slower) 8.07 ns (➖ 1.01x slower)

snapshot_files

load_snapshot_unverified
small 108.33 µs (➖ 1.00x slower)

virtq_readonly

slot_pool_segmented slot_pool_segmented_fragmented
65536 1.94 µs (➖ 1.09x faster) 2.06 µs (➖ 1.08x slower)
262144 7.51 µs (➖ 1.02x slower) 7.26 µs (➖ 1.04x slower)

virtq_readwrite

slot_pool_segmented slot_pool_segmented_fragmented
65536 6.20 µs (➖ 1.09x faster) 6.21 µs (➖ 1.03x faster)
262144 27.47 µs (➖ 1.01x slower)
8192 1.03 µs (➖ 1.02x slower) 1.02 µs (➖ 1.04x faster)
kvm / intel (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 318.89 ns (➖ 1.13x faster)
vec_bytes 86.38 ns (➖ 1.03x faster)
743.20 µs (➖ 1.00x faster)

payload_allocation

slot_pool_segmented
65536 165.62 ns (➖ 1.02x slower)
262144 645.13 ns (➖ 1.08x slower)

sandboxes

create_initialized_and_drop
medium 15.29 ms (➖ 1.01x faster)

slot_pool

alloc_dealloc_4096 alloc_dealloc_1500 alloc_dealloc_128
8.48 ns (➖ 1.02x slower) 8.42 ns (➖ 1.02x slower) 8.42 ns (➖ 1.02x slower)

snapshot_files

load_snapshot_unverified
small 63.19 µs (➖ 1.04x faster)

virtq_readonly

slot_pool_segmented slot_pool_segmented_fragmented
65536 2.51 µs (➖ 1.01x faster) 2.49 µs (➖ 1.03x faster)
262144 8.82 µs (➖ 1.02x faster) 8.79 µs (➖ 1.02x faster)

virtq_readwrite

slot_pool_segmented slot_pool_segmented_fragmented
65536 8.30 µs (➖ 1.06x faster) 8.25 µs (➖ 1.04x faster)
262144 35.35 µs (➖ 1.02x faster)
8192 829.41 ns (➖ 1.05x faster) 835.00 ns (➖ 1.05x faster)
mshv3 / amd (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 352.31 ns (➖ 1.03x slower)
vec_bytes 96.13 ns (➖ 1.01x faster)
313.76 µs (➖ 1.01x faster)

payload_allocation

slot_pool_segmented
65536 192.15 ns (➖ 1.05x slower)
262144 700.03 ns (➖ 1.04x slower)

sandboxes

create_initialized_and_drop
medium 69.08 ms (➖ 1.02x faster)

slot_pool

alloc_dealloc_4096 alloc_dealloc_1500 alloc_dealloc_128
10.36 ns (➖ 1.05x slower) 10.37 ns (➖ 1.02x slower) 10.36 ns (➖ 1.05x slower)

snapshot_files

load_snapshot_unverified
small 99.26 µs (➖ 1.00x faster)

virtq_readonly

slot_pool_segmented slot_pool_segmented_fragmented
65536 2.46 µs (➖ 1.00x slower) 2.62 µs (➖ 1.04x faster)
262144 10.48 µs (➖ 1.19x slower) 9.11 µs (➖ 1.04x faster)

virtq_readwrite

slot_pool_segmented slot_pool_segmented_fragmented
65536 8.03 µs (➖ 1.04x faster) 8.03 µs (➖ 1.08x faster)
262144 35.10 µs (➖ 1.02x faster)
8192 1.29 µs (➖ 1.03x slower) 1.37 µs (➖ 1.08x slower)
mshv3 / intel (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 374.59 ns (➖ 1.07x faster)
vec_bytes 86.22 ns (➖ 1.02x slower)
639.33 µs (➖ 1.00x faster)

payload_allocation

slot_pool_segmented
65536 180.13 ns (➖ 1.08x slower)
262144 679.38 ns (➖ 1.07x slower)

sandboxes

create_initialized_and_drop
medium 54.24 ms (➖ 1.38x faster)

slot_pool

alloc_dealloc_4096 alloc_dealloc_1500 alloc_dealloc_128
9.52 ns (➖ 1.09x slower) 9.50 ns (➖ 1.01x slower) 9.57 ns (➖ 1.10x slower)

snapshot_files

load_snapshot_unverified
small 52.58 µs (➖ 1.02x faster)

virtq_readonly

slot_pool_segmented slot_pool_segmented_fragmented
65536 2.27 µs (➖ 1.00x slower) 2.25 µs (➖ 1.01x slower)
262144 7.96 µs (➖ 1.01x slower) 7.96 µs (➖ 1.01x slower)

virtq_readwrite

slot_pool_segmented slot_pool_segmented_fragmented
65536 7.38 µs (➖ 1.02x faster) 7.49 µs (➖ 1.01x faster)
262144 37.30 µs (➖ 1.05x faster)
8192 897.71 ns (➖ 1.04x faster) 903.80 ns (➖ 1.02x faster)
hyperv-ws2025 / amd (Windows) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 537.59 ns (➖ 1.10x slower)
vec_bytes 145.81 ns (➖ 1.06x slower)
1.87 ms (➖ 1.01x faster)

payload_allocation

slot_pool_segmented
65536 256.58 ns (➖ 1.11x slower)
262144 892.75 ns (➖ 1.12x slower)

sandboxes

create_initialized_and_drop
medium 12.98 ms (➖ 1.09x slower)

slot_pool

alloc_dealloc_4096 alloc_dealloc_1500 alloc_dealloc_128
12.46 ns (➖ 1.17x slower) 12.45 ns (➖ 1.15x slower) 12.45 ns (➖ 1.18x slower)

snapshot_files

load_snapshot_unverified
small 553.17 µs (➖ 1.20x faster)

virtq_readonly

slot_pool_segmented slot_pool_segmented_fragmented
65536 2.56 µs (➖ 1.03x slower) 2.56 µs (➖ 1.02x slower)
262144 8.92 µs (➖ 1.05x slower) 8.72 µs (➖ 1.01x slower)

virtq_readwrite

slot_pool_segmented slot_pool_segmented_fragmented
65536 8.62 µs (➖ 1.01x faster) 8.87 µs (➖ 1.01x slower)
262144 38.77 µs (➖ 1.01x faster)
8192 1.35 µs (➖ 1.00x slower) 1.38 µs (➖ 1.00x slower)
hyperv-ws2025 / intel (Windows) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 541.84 ns (➖ 1.05x faster)
vec_bytes 131.86 ns (➖ 1.08x faster)
3.01 ms (➖ 1.11x faster)

payload_allocation

slot_pool_segmented
65536 256.89 ns (➖ 1.22x slower)
262144 898.35 ns (➖ 1.19x slower)

sandboxes

create_initialized_and_drop
medium 15.61 ms (➖ 1.04x slower)

slot_pool

alloc_dealloc_4096 alloc_dealloc_1500 alloc_dealloc_128
12.60 ns (➖ 1.24x slower) 12.46 ns (➖ 1.27x slower) 12.53 ns (➖ 1.27x slower)

snapshot_files

load_snapshot_unverified
small 577.12 µs (➖ 1.15x faster)

virtq_readonly

slot_pool_segmented slot_pool_segmented_fragmented
65536 2.35 µs (➖ 1.03x slower) 2.31 µs (➖ 1.01x faster)
262144 7.85 µs (➖ 1.03x slower) 7.64 µs (➖ 1.00x slower)

virtq_readwrite

slot_pool_segmented slot_pool_segmented_fragmented
65536 8.48 µs (➖ 1.03x faster) 8.86 µs (➖ 1.06x slower)
262144 44.23 µs (➖ 1.09x slower)
8192 1.15 µs (➖ 1.01x faster) 1.20 µs (➖ 1.16x slower)

Reported by cargo ci bench-report --candidate run:45830664925 --config-file bench_report.toml.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant