public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominik.strasser@onespin-solutions.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/53263] New: priority_queue is very slow if -D_GLIBCXX_DEBUG is used
Date: Mon, 07 May 2012 11:48:00 -0000	[thread overview]
Message-ID: <bug-53263-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             Bug #: 53263
           Summary: priority_queue is very slow if -D_GLIBCXX_DEBUG is
                    used
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dominik.strasser@onespin-solutions.com


Created attachment 27332
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27332
Minimalistic example demonstrating the problem

I've measured the most simplistic usage of priority queue.
With 5,000 elements, the run time is:
real    0m0.005s
user    0m0.002s
sys     0m0.002s
With 10,000 elements, the run time is:
real    0m0.006s
user    0m0.002s
sys     0m0.002s

If I switch on -D_GLIBCXX_DEBUG, the situation changes:
5,000 elements:
real    0m11.216s
user    0m11.210s
sys     0m0.003s

10,000 elements:
real    0m48.354s
user    0m48.344s
sys     0m0.003s

20,000 elements:
real    2m56.971s
user    2m56.941s
sys     0m0.002s

So in addition to some overhead, there seems to be some quadratic behavior
inside the debug version as the run time is 4x for 2x elements.


             reply	other threads:[~2012-05-07 11:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-07 11:48 dominik.strasser@onespin-solutions.com [this message]
2012-05-07 12:06 ` [Bug libstdc++/53263] " paolo.carlini at oracle dot com
2012-05-07 12:07 ` paolo.carlini at oracle dot com
2012-05-07 12:43 ` dominik.strasser@onespin-solutions.com
2012-05-07 12:55 ` paolo.carlini at oracle dot com
2012-05-07 13:37 ` pluto at agmk dot net
2012-05-07 20:51 ` fdumont at gcc dot gnu.org
2012-05-07 21:14 ` paolo.carlini at oracle dot com
2012-05-08  8:07 ` pluto at agmk dot net
2012-05-08  9:56 ` paolo.carlini at oracle dot com
2012-05-08 20:02 ` fdumont at gcc dot gnu.org
2012-05-11 20:20 ` fdumont at gcc dot gnu.org
2012-05-12 21:57 ` paolo.carlini at oracle dot com
2012-05-14 20:20 ` fdumont at gcc dot gnu.org
2012-06-11 15:06 ` dominik.strasser@onespin-solutions.com
2012-06-11 15:27 ` paolo.carlini at oracle dot com
2013-06-24 11:34 ` dominik.strasser@onespin-solutions.com
2013-06-24 11:47 ` dominik.strasser@onespin-solutions.com
2013-06-24 11:51 ` paolo.carlini at oracle dot com
2013-06-24 11:58 ` paolo.carlini at oracle dot com
2013-06-24 12:13 ` dominik.strasser@onespin-solutions.com
2013-06-24 12:17 ` paolo.carlini at oracle dot com
2013-10-16 11:13 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-53263-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).