While parsing xml, I discovered that converting a textual floating point value back to its binary form was expensive. Here are the results of various conversion solutions. Test run on Windows7/x64, HP xw8600 dual quad core Intel Xeon e5440 @ 2.83Ghz, using Visual Studio 2013 update 4.
AToF is a hand written version of the standard atof(). I found the code on the web at:
I am assuming the default atof() and strtod() are slower because they deal with language/locality issues.
StringStream is the slowest way to convert a string back to its binary form.
I created a similar test in the reverse direction and here are the results:
Ratio is elapsed seconds divided by fcvt time.
Release VS2013 on HP xw8600 Xeon E5440 2.83Ghz
Conclusion: fcvt is fastest
Please visit home page for more programs and performance information.