This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Suggested improvement to std::list
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: boltong at nortelnetworks dot com
- Date: Wed, 12 Feb 2003 13:42:28 -0600 (CST)
- Subject: Re: Suggested improvement to std::list
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
In article <3E4A7C6F.D8A897AA@europem01.nt.com> Gawain Bolton writes:
> I would like to humbly suggest an improvement to the std::list container
> class. This improvement does the following:
>
> * reduces amount of memory required
> o the _List_alloc_base class contains a _List_node_base member
> rather than using _List_node<_Tp>.
> * improve performance when creating and destroying lists
> o the constructor no longer allocates memory, since the _M_node
> member in the _List_alloc_base class is not a pointer.
> o this offers a big improvement when creating temporary list
> objects
Sweet. Based on your analysis of retaining O(1), this is probably an
OK change to make in principle. Gawain, do you/Nortel have an
assignment for GCC on file with the FSF?
Could you create a test case that demonstrates an actual performance
improvement? We like to have those for proposed performance patches
(I hold myself to that standard and would like that information before
I consider it for approval).
Next, since this change hits a file included in application code, we
would need to consider when to apply it.
Regards,
Loren