Skip to content

Avoid allocating while parsing packet numbers - #59

Open
glbrntt wants to merge 1 commit into
apple:mainfrom
glbrntt:avoid-alloc-on-packet-parse
Open

Avoid allocating while parsing packet numbers#59
glbrntt wants to merge 1 commit into
apple:mainfrom
glbrntt:avoid-alloc-on-packet-parse

Conversation

@glbrntt

@glbrntt glbrntt commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Motivation:

Parsing a 3-byte packet number allocated a temporary 3-element array to hold the bytes while they were shifted into place.

Modifications:

  • Read the three bytes into locals rather than an array.

Result:

  • Fewer allocations

Motivation:

Parsing a 3-byte packet number allocated a temporary 3-element array to
hold the bytes while they were shifted into place.

Modifications:

- Read the three bytes into locals rather than an array.

Result:

- Fewer allocations
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