This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/15002] Linewise stream input is unusably slow (std::string slow)
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Apr 2004 16:44:08 -0000
- Subject: [Bug libstdc++/15002] Linewise stream input is unusably slow (std::string slow)
- References: <20040418140629.15002.aaron@isotton.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-20 16:44 -------
Paolo, your patch helped a lot (I looked a profile generated by Shark).
I noticed that most of the time now is spent in std::string::_M_mutate from std::string::_M_replace_aux,
not doing much at all.
Some suggestions after looking into the source/asm:
The calculation for __src could be moved inside the if statements, removing a load and two adds.
On the same box as before after Paolo's patch, so a little more than a 2x speedup:
tin:~/src/gnu/gcctest/iotest/iotest>time ./streams
1.340u 0.100s 0:01.43 100.6% 0+0k 0+0io 202pf+0w
tin:~/src/gnu/gcctest/iotest/iotest>time ./streams2
0.430u 0.010s 0:00.44 100.0% 0+0k 0+0io 199pf+0w
tin:~/src/gnu/gcctest/iotest/iotest>time ./stdio
0.080u 0.060s 0:00.15 93.3% 0+0k 0+0io 80pf+0w
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15002