From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24991 invoked by alias); 20 Apr 2004 16:44:08 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 24976 invoked by uid 48); 20 Apr 2004 16:44:08 -0000 Date: Tue, 20 Apr 2004 16:59:00 -0000 Message-ID: <20040420164408.24975.qmail@sources.redhat.com> From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040418140629.15002.aaron@isotton.com> References: <20040418140629.15002.aaron@isotton.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libstdc++/15002] Linewise stream input is unusably slow (std::string slow) X-Bugzilla-Reason: CC X-SW-Source: 2004-04/txt/msg01721.txt.bz2 List-Id: ------- 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