Skip to content

opt float format - #166696

Open
ywxt wants to merge 1 commit into
rust-lang:mainfrom
ywxt:float-format
Open

ywxt wants to merge 1 commit into
rust-lang:mainfrom
ywxt:float-format

Conversation

@ywxt

@ywxt ywxt commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

This PR avoids extra division when formatting big floats or with accuracy.

Group Benchmark x86-64(ns) Change AArch64(ns) Change
Dragon big_exact_12 511.28 → 505.58 −1.11% 1,042.40 → 1,074.62 +3.09%
Dragon big_exact_3 272.40 → 267.61 −1.76% 536.85 → 562.35 +4.75%
Dragon big_exact_inf 10,652.46 → 6,641.25 −37.66% 24,255.97 → 16,808.60 −30.70%
Dragon big_shortest 911.12 → 928.25 +1.88% 1,877.58 → 1,896.35 +1.00%
Dragon small_exact_12 88.19 → 89.38 +1.34% 120.98 → 119.69 −1.06%
Dragon small_exact_3 42.20 → 42.12 −0.20% 60.36 → 59.50 −1.42%
Dragon small_exact_inf 728.47 → 257.78 −64.61% 971.11 → 397.58 −59.06%
Dragon small_shortest 112.03 → 110.72 −1.17% 160.53 → 161.89 +0.85%
Grisu big_exact_12 29.01 → 29.21 +0.69% 40.31 → 40.14 −0.42%
Grisu big_exact_3 14.09 → 13.82 −1.95% 22.77 → 22.70 −0.29%
Grisu big_exact_inf 10,607.63 → 6,718.31 −36.67% 24,239.78 → 16,846.98 −30.50%
Grisu big_shortest 35.83 → 36.97 +3.18% 52.25 → 52.27 +0.05%
Grisu halfway_point_exact_inf 497.45 → 34.55 −93.06% 630.42 → 52.06 −91.74%
Grisu one_exact_inf 499.58 → 34.73 −93.05% 625.75 → 52.06 −91.68%
Grisu small_exact_12 22.12 → 21.83 −1.33% 35.86 → 35.91 +0.14%
Grisu small_exact_3 12.06 → 12.07 +0.04% 19.51 → 19.10 −2.10%
Grisu small_exact_inf 744.94 → 286.53 −61.54% 1,002.06 → 427.93 −57.29%
Grisu small_shortest 18.67 → 18.88 +1.12% 29.63 → 29.70 +0.22%
Grisu trailing_zero_exact_inf 516.40 → 38.70 −92.51% 623.25 → 60.47 −90.30%
flt2dec big_shortest 70.02 → 70.25 +0.32% 92.25 → 91.74 −0.56%
flt2dec small_shortest 49.48 → 49.12 −0.73% 59.97 → 60.04 +0.13%

r? @Amanieu

@rustbot

rustbot commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in float parsing

cc @tgross35

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants