[Bug libstdc++/19642] streaming doubles is very slow compared to sprintf
joerg dot richter at pdv-fs dot de
gcc-bugzilla@gcc.gnu.org
Thu Jan 27 15:05:00 GMT 2005
------- Additional Comments From joerg dot richter at pdv-fs dot de 2005-01-27 15:05 -------
With patch draft_19642_3 and count=1000000
$ time t > /dev/null
real 0,64
user 0,60
sys 0,01
$ time t cout > /dev/null
real 1,14
user 1,12
sys 0,00
Now its only 2 times slower than sprintf. Much better than the ~75 times before.
Also note, that when an other locale than "C" is in place the times also get
better:
without patch: (count=100000)
real 28,27
user 6,34
sys 21,87
with:
real 5,66
user 1,89
sys 3,78
(sprintf:0,07s)
This case is still horrible slow, but 4-5 times better than before.
Good work so far, but I think the final solution is to avoid any frequent
setlocale() calls.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19642
More information about the Gcc-bugs
mailing list