Possible shortcut for format_exact_opt in Grisu3 #110129
Labels
A-floating-point
Area: Floating point numbers and arithmetic
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
In the .NET implementation of Grisu3, there's a shortcut to jump out earlier when the fractionals or integrals cannot meet the determination of requested digits. This significantly improved the performance of converting floating number to string as it falls back even without starting trying the Grisu3 algorithm. This was originally added in this PR, and shipped along with all later .NET versions so it's proved working.
Below is the code snippet from current .NET repo:
I'm wondering do we consider apply the same shortcut just after
vint
andvfrac
extracted at line 489 of grisu.rs?The text was updated successfully, but these errors were encountered: