-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Can the standard library benefit from this? #1
Comments
There are some differences that would make it a big breaking change for libcore to switch to this implementation. This library formats For itoa I filed dtolnay/itoa#1 to fix the implementation in libcore because that one is a pure performance improvement with no other user-facing differences. |
Oh, so the speedup is mostly because fewer characters need to be written? That is something that can be fixed to some degree. You're right that the format of I think an RFC that defines alternative, shorter formats would result in a lot of bikeshedding but ultimately be accepted. Maybe in a few weeks I'll get around to writing such an RFC. |
Yes and no. The most dramatic speedups are because of that, but even numbers that print out exactly the same are faster by a factor of 2. This is because we avoid the overhead of the I would support having this algorithm behind a non-default format string in the standard library. |
It is my understanding that the main motivation for this library is avoiding the overhead of the
std::fmt
infrastructure, but I noticed that unlike itoa this isn't the implementation from libcore but an independent one. It's the same basic algorithm (Grisu) but perhaps the separate lineage of the code means there are some optimizations in this implementation that the libcore implementation would also benefit from?The text was updated successfully, but these errors were encountered: