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

Improve performance when parsing integers. #124

Merged
merged 6 commits into from
Sep 12, 2024
Merged

Improve performance when parsing integers. #124

merged 6 commits into from
Sep 12, 2024

Conversation

Alexhuszagh
Copy link
Owner

@Alexhuszagh Alexhuszagh commented Sep 12, 2024

This uses the unchecked loop enhancements from rust core while also adding in our own, multi-digit enhancements and being able to use the best to highly tune performance. The optimizations for multi-digit optimizations can be configured, and it also uses some optimizations such as unchecked mul-add for the first <=N (rough overflow digit estimation) digits and only checked mul-add for the rest.

For large strings, such as 64-bit and larger integers with 10+ characters, multi-digit optimizations can improve performance by 70%. But for small, simple strings it can lead to a 5-20% performance penalty. This behavior can be toggled on and off for optimal behavior.

This PR also reduces binary sizes when the compact feature is enabled.

This uses the unchecked loop enhancements from rust core while also
adding in our own, multi-digit enhancements and being able to use the
best to highly tune performance.

This commit also reduces binary sizes when the compact feature is
enabled.
@Alexhuszagh Alexhuszagh added the enhancement New feature or request label Sep 12, 2024
@Alexhuszagh Alexhuszagh merged commit 196d10d into main Sep 12, 2024
@Alexhuszagh Alexhuszagh deleted the integer branch September 12, 2024 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Make Disabling of Multi-Digit Parsing Optimizations Configurable
1 participant