This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/19642] streaming doubles is very slow compared to sprintf
- From: "joerg dot richter at pdv-fs dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jan 2005 15:05:41 -0000
- Subject: [Bug libstdc++/19642] streaming doubles is very slow compared to sprintf
- References: <20050126142651.19642.joerg.richter@pdv-fs.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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