public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "SWElef at post dot sk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/19422] New: assoc. containers: ctor taking range is O(n log n) even if the range is sorted
Date: Thu, 13 Jan 2005 12:05:00 -0000	[thread overview]
Message-ID: <20050113120525.19422.SWElef@post.sk> (raw)

The template constructor of associative containers with range [first,last)
should have linear complexity if the range is sorted. libstdc++ fails to
comply.

This is quite evident when looking at the include file bits/stl_tree.h,
more precisely the functions insert_unique and insert_equal taking ranges.

To be sure I made some runtime tests. The complexity is really O(n log n),
where n=distance(first,last). It is not evident with the default allocator,
but one can see the trend. I also tested with a self-made single-threaded
pool allocator and the results were very clear. I can submit the source
if need be.

Regards,
Vladimir Marko

-- 
           Summary: assoc. containers: ctor taking range is O(n log n) even
                    if the range is sorted
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: SWElef at post dot sk
                CC: gcc-bugs at gcc dot gnu dot org


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


             reply	other threads:[~2005-01-13 12:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-13 12:05 SWElef at post dot sk [this message]
2005-01-13 12:08 ` [Bug libstdc++/19422] " SWElef at post dot sk
2005-01-13 12:25 ` pcarlini at suse dot de
2005-01-13 13:05 ` pcarlini at suse dot de
2005-01-13 16:59 ` SWElef at post dot sk
2005-01-13 17:21 ` pcarlini at suse dot de
2005-01-13 17:29 ` pinskia at gcc dot gnu dot org
2005-01-13 17:30 ` pinskia at gcc dot gnu dot org
2005-01-13 17:40 ` pcarlini at suse dot de
2005-01-14  8:25 ` SWElef at post dot sk
2005-01-14 11:50 ` pcarlini at suse dot de
2005-01-14 13:33 ` SWElef at post dot sk
2005-01-14 14:28 ` pcarlini at suse dot de
2005-01-14 21:09 ` cvs-commit at gcc dot gnu dot org
2005-01-14 22:47 ` pcarlini at suse dot de

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=20050113120525.19422.SWElef@post.sk \
    --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).