3 ms·
It's not silly at all. Replacing a lot of sprintf calls with Grisu and later Ryu made a huge difference in the production fleet at my last job. It wasn't by a
by thedance 7y ago
It's not silly at all. Replacing a lot of sprintf calls with Grisu and later Ryu made a huge difference in the production fleet at my last job. It wasn't by any means "the bottleneck" but it was costing real money. Most of the calls were in peripheral functions like debug logs, status page outputs, and whatnot.
That said, I've never seen strtod showing up in my profiles, but I bet if I was profiling web browsers then I would see it.
- MaxBarraclough 7y agoI was wondering if ctrl-f for 'Ryu' would match anything. Jeroen van der Zijp, developer of the lesser known FOX Toolkit, claims to have done better than the Ryu algorithm. From his changelist [0]: > New, faster, and often more accurate floating point to string conversion. No, this is not based on Ryu paper. New method reliably generates 16 digits, and does much better rounding. I believe this [1] is his implementation in C++. See also his paper [2]. (I believe it's not peer-reviewed, but it does appear in Google Scholar.) [0] http://www.fox-toolkit.org/ http://www.fox-toolkit.org/ [1] https://github.com/gogglesguy/fox/blob/77396c638c1c4e05/lib/fxprintf.cpp#L381 https://github.com/gogglesguy/fox/blob/77396c638c1c4e05/lib/... [2] http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf