This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: performance analysis producer_consumer.cc TEST_T5
- From: Paolo Carlini <pcarlini at suse dot de>
- To: law at redhat dot com
- Cc: Will Cohen <wcohen at redhat dot com>,Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>,libstdc++ at gcc dot gnu dot org
- Date: Tue, 17 Feb 2004 17:42:03 +0100
- Subject: Re: performance analysis producer_consumer.cc TEST_T5
- References: <200402171630.i1HGUi5f016034@speedy.slc.redhat.com>
law@redhat.com wrote:
In message <4030DE6D.50607@redhat.com>, Will Cohen writes:
>I looked over the code a bit more. The tight loop that the code spends
>most of its time is the result of the size() operation. The code is
>counting the number of elements in the list. The size() operation for
>the list basically has to walk the linked list. The means of counting
>the number of objects in other containers don't have a size() operation
>that is O(n). The other size operations usually get a couple values,
>subtract, and scale the result. There are two possible reasons I can
>think of things going wrong with the list version as a result of the
>size() operation not being atomic:
Funny, a one of the customers you visited a couple weeks ago has complained
repeatedly about not having an efficient means to get the number of objects
on a list....
Hi. The obvious citation:
http://gcc.gnu.org/onlinedocs/libstdc++/23_containers/howto.html#6
It would be easy to change that, if we reach an agreement about the
concerned
trade-offs...
Paolo.