Skip to content

Avoid allocating while parsing packet numbers - #59

Merged
tfpauly merged 1 commit into
apple:mainfrom
glbrntt:avoid-alloc-on-packet-parse
Jul 30, 2026
Merged

Avoid allocating while parsing packet numbers#59
tfpauly merged 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
@tfpauly
tfpauly merged commit fd1d0b8 into apple:main Jul 30, 2026
23 checks passed
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.

4 participants