no plus ones
Shared publicly•View activity
- I see that ostringstream constructor is a bit faster than just stringstream (tested using your benchmark from github).Feb 10, 2015
- The trouble with (string)stream constructor is the call to std::locale constructor, and then multiple queries to it to get all the things like decimal point and num. separator right. This is the part that takes most of the observed time. Alas, there is no standard way to eliminate the expensive call by passing in an already constructed locale. As a nice bonus --the locale uses a global data, so it has to be locked in order to work properly. Which makes concurrent construction of stringstreams even slower. Well, at least calling the clear method on a stringstream is cheap. In one of our projects we simply used a pool of stringstream objects (per thread).Feb 10, 2015
- Multi-threaded execution is a special kind of fun. I hope to say a few words about it one day.Feb 10, 2015
Add a comment...