Good one! Have been looking for a solution to the apparently non-trivial problem of FAST float parsing. Clang and GCC not making any moves to support this part of C++17… 🙁
Building abseil::string now!
Oliver Schönrocksays:
bad news…
i haven’t done very scientific testing, but it looks like absl::from_chars is dead slow for doubles
I could do a
std::string(const char* start_ptr, const char* end_ptr) field; // AND
stod(field);
and still be twice as fast as char_conv, which can do that in one step.
(I am iterating through a 190MB mmap’ed file of floats).
Don’t post this article then, or upgrade, we’re gcc-10 if I understand things correctly.
Iff I would believe STL (lead STL dev), on Windows (the VC-STL, not some surrogate) this function (from_chars) beats anything.
As of November 2019, looking at the source code in the GNU GCC repo, I do not see support for floats in from_chars.
Are you saying that it available in GNU GCC 10? When was that released?
The world does not start and end with GNU GCC [and living on the edge 😉 is more fun].
It does not look like it is available with LLVM at this time.
If someone can help me port my code to Visual Studio, while preserving the performance counters, I will gladly run the tests.
You can also try the abseil implementation of from_chars (https://github.com/abseil/abseil-cpp/blob/master/absl/strings/charconv.h )
Good one! Have been looking for a solution to the apparently non-trivial problem of FAST float parsing. Clang and GCC not making any moves to support this part of C++17… 🙁
Building abseil::string now!
bad news…
i haven’t done very scientific testing, but it looks like absl::from_chars is dead slow for doubles
I could do a
std::string(const char* start_ptr, const char* end_ptr) field; // AND
stod(field);
and still be twice as fast as char_conv, which can do that in one step.
(I am iterating through a 190MB mmap’ed file of floats).