On Tuesday, October 4, 2016 at 2:28:12 PM UTC-5, Öö Tiib wrote:
> On Tuesday, 4 October 2016 21:01:40 UTC+3,
woodb...@gmail.com wrote:
> > Around the 47 minutes and 40 seconds mark in this video
> >
> >
https://www.youtube.com/watch?v=vElZc6zSIXM&spfreload=1
> >
> > Chandler Carruth says: "the std::deque data type is
> > really quite bad. I wouldn't recommend anyone use
> > it for anything." Do you agree that std::deque should
> > be added to std::junkpile?
>
> Container's performance does not care about opinions of whatever young
> googlers, youtubers or llvmers the internet keeps spitting at us.
> 'std::deque' is doing quite well in profile of several algorithms.
Really?
>
> >
> > I've known about some of the problems with std::deque
> > for years, but I have one place where I use it here:
> >
> >
http://webEbenezer.net/misc/cmwAmbassador.cc
> >
> > . I'm not sure what would be a better alternative there.
> > Tia.
>
> The standard library containers are all likely performing worse for
> FIFO of smart pointers that you seem to have there. 'std::queue'
> (adaptor) makes its usage likely slightly less verbose and also
> documents better that it is FIFO.
I agree with you about std::queue documenting better that
it's a FIFO, but disagree about the usage being less verbose:
::std::deque<::std::unique_ptr<cmw_request> > pendingTransactions;
versus
::std::queue<::std::unique_ptr<cmw_request>
,::std::deque<::std::unique_ptr<cmw_request>>
> pendingTransactions;
So I'm not sure that the gain in readability by using std::queue
would be worth it. If we could write that instead as:
::std::queue<::std::deque<::std::unique_ptr<cmw_request>>
> pendingTransactions;
, I'd be more inclined to use it. I guess that's a wart in
the container adaptors.
>
> From outside of standard library it may easily be that for example 'boost::circular_buffer_space_optimized' is performing better there.
> That needs profiling, if it matters.
I can use Boost containers in the back tier of the C++ Middleware
Writer, but not here as they aren't portable enough. Maybe it's
more of a distribution problem than a portability problem.
Brian
Ebenezer Enterprises - "Remember that you were slaves in Egypt and
that the L-rd your G-d set you free." Deuteronomy 24:18
http://webEbenezer.net