Skip to content

dtoa.c: Use an on-stack buffer for small bigints #13234

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

jhawthorn
Copy link
Member

@jhawthorn jhawthorn commented May 1, 2025

In #12991 I replaced a spinlock with malloc, which is about the same performance.

I think malloc implementations have gotten better since 1990 when dtoa.c was written, but this can still be a bit of a bottleneck. We seem to mostly be allocating a few small bigints (k <= 2) at a time, so this PR adds a small on-stack buffer we can allocate from without synchronization.

I need to test this a bit more before merging.

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