Skip to content

Conversation

@aaronddavies
Copy link

@aaronddavies aaronddavies commented Nov 7, 2025

This PR preserves the IPv4 fixed length fields that were being dropped. They are now parsed directly into the Ipv4Repr struct.

The exception is header length, which is always 20 bytes, until options support is implemented. Options is a variable length field that will be implemented in a separate PR.

Bench tests

develop @ 39cd44e
test wire::bench_emit_ipv4 ... bench:           8.07 ns/iter (+/- 0.18)
test wire::bench_emit_ipv6 ... bench:           1.12 ns/iter (+/- 0.01)
test wire::bench_emit_tcp  ... bench:          30.81 ns/iter (+/- 0.85)
test wire::bench_emit_udp  ... bench:          26.34 ns/iter (+/- 11.85)

1095-preserve-all-fixed-ipv4-fields @ 9c2b2c3
test wire::bench_emit_ipv4 ... bench:           8.52 ns/iter (+/- 0.19)
test wire::bench_emit_ipv6 ... bench:           1.13 ns/iter (+/- 0.03)
test wire::bench_emit_tcp  ... bench:          31.88 ns/iter (+/- 0.73)
test wire::bench_emit_udp  ... bench:          26.35 ns/iter (+/- 1.32)

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant