Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Int32Packer and ValueInt32Packer #68

Merged
merged 3 commits into from
Dec 27, 2023
Merged

Conversation

NightOwl888
Copy link
Owner

Added Int32Packer and ValueInt32Packer that use ulong variables to pack up to 32 int values up to 65535. These types can be used to replace arrays under those limits with a structure that has a smaller memory footprint. In the case of ValueInt32Packer, these values will always be allocated on the stack.

This also adapts ValueStringBuilderChunkIndexer to use ValueInt32Packer to store its upper bounds.

ValueStringBuilderArrayPoolIndexer also changed to use a smaller array from ArrayPool<char>.Shared when indexing shorter StringBuilder instances.

…t32Packer instead of ChunkBoundsPacker. ValueInt32Packer stores twice as many chunks (32) and we only need to allocate 1 int[] instead of 2 when we go over that limit.
…he length if below ChunkLength (ensuring it doesn't go below 1).
@NightOwl888 NightOwl888 merged commit 34d8b3e into main Dec 27, 2023
20 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.

1 participant