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

PERFORMANCE: J2N.Text.ValueStringBuilderChunkIndexer: Use ArrayPool for upperBounds array #69

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

NightOwl888
Copy link
Owner

The upperBounds array is allocated only if we exceed 32 chunks or 65535 characters,. Being that this is a ref struct that is used once per method call, it makes sense to reuse the array if we spill over these values to make optimal use of memory.

This makes ValueStringBuilderChunkIndexer disposable, but it is a fair tradeoff for what we gain.

@NightOwl888 NightOwl888 merged commit 65ab746 into main Dec 27, 2023
0 of 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.

1 participant