From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18361 invoked by alias); 9 Dec 2010 21:05:39 -0000 Received: (qmail 18351 invoked by uid 22791); 9 Dec 2010 21:05:38 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Dec 2010 21:05:34 +0000 From: "fdumont at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/46659] std::list iterator debugging (_GLIBCXX_DEBUG) is much slower than stlport's one. X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: fdumont at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Thu, 09 Dec 2010 21:05:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg01047.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D46659 --- Comment #9 from Fran=C3=A7ois Dumont 2010-= 12-09 21:05:22 UTC --- testsuite performance suite already show very good results but this test is rather explicit too. What will perhaps surprise you is that the only optimization that can explain this difference is in the '++j'. This operation require the iterator to be incrementable which is checked us= ing mostly !M_is_end(). This operation used to be performed with the creation o= f an internal safe iterator end() resulting in: - creation/destruction of this safe iterator with the respective insertion/deletion from the safe iterator list (with mutex locks) - additional checks when comparing this internal iterator with j. With the patch the check is done using a normal iterator avoiding all those operations.