public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19422] New: assoc. containers: ctor taking range is O(n log n) even if the range is sorted
@ 2005-01-13 12:05 SWElef at post dot sk
  2005-01-13 12:08 ` [Bug libstdc++/19422] " SWElef at post dot sk
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: SWElef at post dot sk @ 2005-01-13 12:05 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2005-01-14 22:47 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-13 12:05 [Bug c++/19422] New: assoc. containers: ctor taking range is O(n log n) even if the range is sorted SWElef at post dot sk
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

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).