4 ms·
How does this compare to std::stringstream? I don't see any mention of that class in this article.
by ndepoel 13y ago
How does this compare to std::stringstream? I don't see any mention of that class in this article.
- CJefferson 13y agoI was just about to post this. 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): Accurate performance test: ostringstream took 0.0120331 seconds, and ToString() took 0.0221947 seconds. The relative speed improvement was -45.784% Join took 0.0176613 seconds.
- jonhohle 13y agoI 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%
- zenbowman 13y agoExactly, seems like he's just reimplemented std::stringstream in a worse manner.