Date: 2008oct1
Language: C/C++
Keywords: Standard Template Library, optimize
Q. How can I make my STL <list> faster?
A. <list> is doubly-link which isn't needed in many applications.
Consider using <slist> which is singly-linked. Takes less time linking
and it also uses less space.
Try using a <vector> instead. You might be surprised. Its sometimes
faster since it doesn't have do a malloc() for each element.
Can you reserve() some space? This often helps.
| What this info useful to you? You can donate to say thanks |
Add a comment
Sign in to add a comment