Skip to content

Reserve the full length when building an encoding - #184

Merged
ia0 merged 2 commits into
ia0:mainfrom
g4lb:reserve-encoding-capacity
Nov 25, 2026
Merged

ia0 merged 2 commits into
ia0:mainfrom
g4lb:reserve-encoding-capacity

Conversation

@g4lb

@g4lb g4lb commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Specification::encoding() now reserves the full length once. The output does not change.

Specification::encoding() Before After Change
hex 217 ns 78.2 ns -63.9%
base64 170 ns 68 ns -59.9%
base64 with wrap and ignore 187 ns 86.5 ns -53.8%
base2 with translate 403 ns 240 ns -40.6%

Encode and decode did not change (criterion, Apple M5).

@ia0

ia0 commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR!

@ia0
ia0 merged commit 6a2bb21 into ia0:main Nov 25, 2026
2 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.

2 participants