public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/46659] New: std::list iterator debugging (_GLIBCXX_DEBUG) is much slower than stlport's one.
@ 2010-11-25 15:34 pluto at agmk dot net
  2010-11-25 15:59 ` [Bug libstdc++/46659] " redi at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: pluto at agmk dot net @ 2010-11-25 15:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46659

           Summary: std::list iterator debugging (_GLIBCXX_DEBUG) is much
                    slower than stlport's one.
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pluto@agmk.net


Created attachment 22532
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22532
testcase with preprocessed sources.

an evil testcase:

#include <list>
#include <vector>
int main()
{
        typedef std::list< int > L;
        L list;
        typedef std::vector< L::const_iterator > V;
        V vec;
        for ( int i = 0; i < 30000; i++ )
                list.push_back( 42 );
        for ( L::const_iterator j = list.begin(); j != list.end(); ++j )
                vec.push_back( j );
        list.clear();
}

compilation with libstdc++ and stlport-5.2.1 for benchmarking:

/local/devel/toolchain45/x86_64-gnu-linux.mt_alloc/bin/x86_64-gnu-linux-g++
-pthread -O2 -Wall -D_GLIBCXX_DEBUG --save-temps \
        t.cpp -o t-libstdcxx
mv t.ii t-libstdcxx.ii

/local/devel/toolchain45/x86_64-gnu-linux.mt_alloc/bin/x86_64-gnu-linux-g++
-pthread -O2 -Wall -D_STLP_DEBUG=1 -isystem ./STLport-5.2.1/include/stlport
--save-temps \
        t.cpp -o t-stlport ./STLport-5.2.1/lib64/libstlportstlg.a
mv t.ii t-stlport.ii


and few benchmarks on athlon64-2800+:

20000 elements:

$ time ./t-libstdcxx
./t-libstdcxx  8,28s user 0,00s system 97% cpu 8,458 total
$ time ./t-stlport  
./t-stlport  4,57s user 0,01s system 98% cpu 4,644 total

30000 elements:

$ time ./t-libstdcxx
./t-libstdcxx  19,03s user 0,01s system 97% cpu 19,433 total
$ time ./t-stlport
./t-stlport  8,93s user 0,00s system 98% cpu 9,095 tota


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-12-09 21:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-25 15:34 [Bug libstdc++/46659] New: std::list iterator debugging (_GLIBCXX_DEBUG) is much slower than stlport's one pluto at agmk dot net
2010-11-25 15:59 ` [Bug libstdc++/46659] " redi at gcc dot gnu.org
2010-11-25 17:06 ` paolo.carlini at oracle dot com
2010-11-25 19:48 ` pluto at agmk dot net
2010-12-07 11:06 ` paolo.carlini at oracle dot com
2010-12-07 21:40 ` redi at gcc dot gnu.org
2010-12-07 22:05 ` pluto at agmk dot net
2010-12-07 22:10 ` paolo.carlini at oracle dot com
2010-12-07 22:19 ` pluto at agmk dot net
2010-12-07 22:30 ` paolo.carlini at oracle dot com
2010-12-09 21:05 ` fdumont at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).