Re:Performance Improvement with the StringBuilder for C++
by jonhohle on Friday September 06, 2013 @10:47AM
(#6340696)
I came to post the same thing, and got similar results:
Accumulate took 0.00195327 seconds
ToString() took 0.00283577 seconds.
Join took 0.00462704 seconds.
stringstream took 0.00084927 seconds.
The relative speed improvement was -71.1482%
If I use ostringstream, and also I change the code so it has to construct the StringBuilder every test (at the moment they build it once and then keep calling 'toString'), then I get the output (from the test program on that website):