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

Consider using Grisu3 + Dragon4 for double.ToString() conversion. #5609

Open
mazong1123 opened this issue Aug 18, 2018 · 1 comment
Open

Comments

@mazong1123
Copy link

mazong1123 commented Aug 18, 2018

I saw we are using library function swprintf_s to convert a double value to string, which has performance issues that have been discussed in .NET Core. See https://github.com/dotnet/coreclr/issues/10390 and https://github.com/dotnet/coreclr/issues/10651

In .NET Core 2.0, there's a new implementation that combined Grisu3 + Dragon4 algorithms to significantly improved the performance (I should say probably 7x faster). See these two PRs: dotnet/coreclr#14646
dotnet/coreclr#12894

Replace swprintf_s with the new implementation could make the double conversion much more faster.

@Artoria2e5
Copy link

Or maybe the C Runtime people can be persuaded to just implement that in their library? That would be a bit idealistic, of course...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants