|
From: James Dennett on 11 Jan 2008 02:56 Matthias Buelow wrote: > Victor V. Terber wrote: > >> Does such a replacement of list by deque seem reasonable? Would you >> typically expect real-world performance changes? > > If properly implemented, ordinary lists and doubly-linked lists have the > same performance characteristics for common operations. The only > advantage of a doubly-linked list is that you can traverse it backwards. But that's not the question here, as std::deque is *not* a linked list, but rather a container supporting random access iterators. As others have noted, performance is likely to be better in the user's application because of the reduced use of dynamic memory allocation, *but* if the memory allocator is good or if elements are rarely added compared to how often they are read then the additional complexity of std::deque might overwhelm the memory allocation costs. -- James -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]
|
Pages: 1 Prev: Objects returned by value don't use copy constructors! Next: About Int2Type |