-
Notifications
You must be signed in to change notification settings - Fork 1
updating fmt to version 12 and use compile-time format strings #51
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for updating {fmt} usage! |
|
@vitaut Your comments on our work are much appreciated. |
jaja360
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I observe ~30% speedup with the new version on my CPU.
PR looks reasonable. We can merge !
|
Note that {fmt} uses Dragonbox so it's interesting to see a big gap between the two, even after the update. Some gap is expected because {fmt} is a higher-level facility but it's normally much smaller, e.g. on Milo Yip's dtoa-benchmark the gap is ~8%. I would investigate further but the FP implementation in {fmt} is about to be revamped (Dragonbox replaced with https://github.com/vitaut/zmij) so it's probably doesn't matter except that I would recommend adding version information since there is substantial difference between versions and even different algorithms used. |
|
Thank you, @jaja360! |
Fixes #50
This follows comments by a few people, including @vitaut (the fmt author).
These changes drastically change change the performance of fmt, for the better.
On my Apple M4.... before...
after...
In context, this makes (in one test), the fmt library much closer to
std::to_chars.Context: Daniel Lemire, "Converting floats to strings quickly," in Daniel Lemire's blog, February 1, 2026, https://lemire.me/blog/2026/02/01/converting-floats-to-strings-quickly/.