Skip to content

docs(ion-1-1): optimize fixed-size decimal encoding for common cases - #416

Merged
popematt merged 1 commit into
amazon-ion:gh-pagesfrom
popematt:small-decimal-exponent
Oct 16, 2026
Merged

popematt merged 1 commit into
amazon-ion:gh-pagesfrom
popematt:small-decimal-exponent

Conversation

@popematt

Copy link
Copy Markdown
Contributor

Issue #, if available:

None

Description of changes:

Changes the binary encoding of small decimals in the Ion 1.1 spec so the exponent is a fixed 1-byte FixedInt instead of a variable-width FlexInt.

This reduces branching by eliminating the FlexInt for common case decimals (exponent in -128..127 inclusive)

Encoded size is 1 byte smaller when the exponent is in -128..-65 or 64..127, but one byte larger for exponents outside -128..127.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@popematt
popematt merged commit 81361fa into amazon-ion:gh-pages Oct 16, 2026
1 check 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