Not sure how to answer your question. You seem to want us to write a benchmark program that you could easily write yourself. So instead of doing that, I'll just state this:
- With a
list
, every item you push will incur a memory allocation.
- With a
deque
, large blocks are allocated at once.
Given that memory allocation is normally slow, I would expect the deque
to out-perform list.
If you push or pop many items at once, this will be especially true, as cache locality comes into play.
Of course, you could write an allocator on the list to use a memory pool. Then you might get better performance.
So with these hypotheses in mind, go away and measure it, and if you want to discuss the results, that would be the time to ask a question.