This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libstdc++/9606: performance regression in operator<<(ostream&,int)


>Number:         9606
>Category:       libstdc++
>Synopsis:       performance regression in operator<<(ostream&,int)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 06 23:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Joe Buck
>Release:        gcc-3.2.1 (actually, all gcc-3.x releases)
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
Compile and run the test program below with
g++ -O3 prog.C -o prog

and time it.  For gcc 3.2.1 on a Xeon 2.2 GHz box,
it takes 17.39 sec, but for gcc 2.95.3, it takes
2.06 sec.

It seems that the difference is that snprintf is
now used.

>How-To-Repeat:
// this is the test program.
#include <fstream>

int main(int argc, char** argv) {
    std::ofstream sink("/dev/null");
    for (int i = 0; i < 10000000; i++)
	sink << i;
    return 0;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]