Forricideon Hacker News • Recommends
On “C++20, How Hard Could It Be”
#charconv#floating-point#ryualgorithm
189K subscribers • 101 videos on Hallway • Conference channel
Advanced. Deep dive for people who know the field.
40K views7 years ago3 recommendations
Systems programmingProgramming languagesC++Performance and optimizationAlgorithms
Stephan T. Lavavej explains the implementation of fast floating-point to-string and string-to-floating-point conversions in Microsoft's C++ standard library.
CppCon.org — Discussion & Comments: reddit.com/r/cpp/ — Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/CppCon/CppCon2019 — Floating-point numbers are ancient, mysterious, and terrifying. Over the past 30 years, the C and C++ Standards have provided many functions for floating-point/string conversions, such as C's strtof(), strtod(), and printf() %a %e %f %g, and C++'s iostreams, stof(), stod(), and to_string(). Despite this history, floating-point is far from a solved problem - these functions have ranged from annoyingly to egregiously slow, and application developers and library maintainers alike have found it exceedingly difficult to understand floating-point behavior. This session will present new and wondrous developments in the area of floating-point conversions. If your serialization code is bottlenecked by floating-point printing, this will accelerate your code by roughly 3x to 30x (yes, times, not percent). You can also improve the human-readability of your output. Along the way, this session will cover the basics of floating-point representations, dispelling common myths like fuzziness and non-determinism. Specifically, C++17 added 3 pages of Standardese describing the charconv header and its functions from_chars() and to_chars(). This feature has required an unexpectedly large amount of implementation work, taking over a dev-year for MSVC and becoming the last C++17 library feature to ship. Coincidentally, Ulf Adams at Google developed a novel algorithm named Ryu, which is responsible for the amazing speed of to_chars(). This session will focus on how to use charconv and how to understand its many supported formats, with a brief overview of Ryu's techniques. — Stephan T. Lavavej Microsoft Principal Software Engineer Redmond, WA Stephan T. Lavavej is a Principal Software Engineer at Microsoft, maintaining Visual C++'s implementation of the C++ Standard Library since 2007. He also designed a couple of C++14 features: make_unique and the transparent operator functors. He likes his initials (which people can actually spell) and cats (although he doesn't own any). — Videos Filmed & Edited by Bash Films: BashFilms.com Work at Hudson River Trading (HRT): tinyurl.com/safxfctfWhat people say. Recommended as an entertaining and deep dive into the complex algorithms behind high-performance floating-point conversions in C++.
Forricideon Hacker News • Recommends
On “C++20, How Hard Could It Be”
osoloon Hacker News • Recommends
On “Parsing floats in C++: benchmarking strtod vs. from_chars”
ygraon Hacker News • Recommends
On “Rendering floating numbers: advances in problems you didn’t know you had (2011)”
Kaznovon Stack Overflow • Mentions
On “Locale-independent "atof"?”
ygraon Hacker News • Mentions
On “Floating Point in the Browser, Part 1: Impossible Expectations”
StephanTLavavejon Hacker News • Mentions
On “C++20, How Hard Could It Be”