2 ms·
I 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
by CJefferson 13y ago
I 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%