This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: std::deque implementation seems non-optimal for use with std::queue
- From: Joachim Achtzehnter <joachima at netacquire dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>, Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 22 Jan 2014 09:22:55 -0800
- Subject: Re: std::deque implementation seems non-optimal for use with std::queue
- Authentication-results: sourceware.org; auth=none
- References: <52DF1F13 dot 1020404 at netacquire dot com> <52DF246E dot 2010909 at netacquire dot com> <CAH6eHdR2Ymf3QCWGdqU2Dack+YWLdDQ60FfHjeMg4k1HtMCCEg at mail dot gmail dot com> <52DF9BB6 dot 90502 at oracle dot com>
Yes, keeping (at least) one empty node around, as suggested in a message
from 2005 (http://gcc.gnu.org/ml/libstdc++/2005-11/msg00031.html), would
help with my use case. Not freeing nodes at all in pop_front() or
pop_back() is probably easier to implement, but I get the impression
that there is reluctance to go this far? This does appear to be
Microsoft's approach, where nodes are only freed by clear() or when the
whole contents is replaced via assignment, etc.
Joachim
--
joachima@netacquire.com http://www.netacquire.com