Skip to content

SwiftQUIC: Adopt SmallArray to avoid heap allocations for FrameAck - #266

Open
agnosticdev wants to merge 6 commits into
mainfrom
agnosticdev/AckRanges
Open

agnosticdev wants to merge 6 commits into
mainfrom
agnosticdev/AckRanges

Conversation

@agnosticdev

Copy link
Copy Markdown
Collaborator

Introduces a new type called SmallArray so we do not have to hit the heap for storing one or two elements.
In this case we are using it when parsing AckRanges and for the common, good-network case of having one or two AckRanges.

This will save us a heap hit per FrameAck that is parsed:

0	_ContiguousArrayStorage<FrameAckRange>	0 Bytes	0	2186	102.47 KiB	2186	Ratio: %0.00, %0.00

This PR will replace this PR:
#234

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

Labels

⚠️ semver/major Breaks existing public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant