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

More effisient formatting of numbers with small decimal mantissas #11

Closed
wants to merge 1 commit into from
Closed

Conversation

plokhotnyuk
Copy link

@plokhotnyuk plokhotnyuk commented May 25, 2019

Results for 0.1

Before:

             Average   Stddev
pretty32:      26.083    0.628
pretty64:      52.132    0.331

After:

             Average   Stddev
pretty32:      20.886    0.481
pretty64:      42.843    0.249

Results for 0.12345678

Before:

             Average   Stddev
pretty32:      18.052    0.871
pretty64:      39.528    0.211

After:

             Average   Stddev
pretty32:      18.124    0.726
pretty64:      34.618    0.210

Results for 0.12345678912345678

Before:

             Average   Stddev
pretty32:      18.052    0.604
pretty64:      26.635    0.204

After:

             Average   Stddev
pretty32:      18.123    0.668
pretty64:      27.461    0.151

A big thanks to @andy128k for his help in writing and debugging of these changes.

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I am closing the PR because I don't feel comfortable diverging from the C code at this point. As the readme says, this is a line-by-line port. Being able to port future performance improvements easily from C to Rust is more valuable in expected future performance than this optimization. You could publish this as a fork under a different crate name, or follow up in ulfjack/ryu.

@dtolnay dtolnay closed this May 31, 2019
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