[Bug libstdc++/15002] Linewise stream input is unusably slow (std::string slow)
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Apr 20 16:59:00 GMT 2004
------- 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
More information about the Gcc-bugs
mailing list