Boost logo

Boost Users :

Subject: Re: [Boost-users] lexical_cast between double and string slow in Visual Studio 2013
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2014-03-24 07:31:58

2014-03-24 15:05 GMT+04:00 David Roberts <dave_at_[hidden]>:

> In Boost 1.54 I have noticed that lexical_cast from double to string and
> back is much slower in Visual Studio 2013 (Visual C++ 12) than it was in
> Visual Studio 2010 (Visual C++ 10).

> Is this already a known issue? If not I can do a bit more investigation
> to narrow down why it's so much slower, but I don't want to waste my time
> if this has already been done.

That issue is unknown. I'd really appreciate the investigation.

Try excluding the lexical_cast from test, I have a feeling that this is
only MSVC related issue:

#include <sstream>
#include <string>

int main (int, char **)
    for (double count = 0.0; count < 1000000.0; count += 1.41)
        std::stringstream ss;
        ss << count;
        std::string result = std::move(ss.str());

        ss << result;
        ss >> count;

    return 0;

Best regards,
Antony Polukhin

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at