Boost logo

Boost Users :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2006-07-13 17:58:51


bringiton bringiton wrote:
> On 7/12/06, bringiton bringiton <kneeride_at_[hidden]> wrote:
>
>>On 7/12/06, Cory Nelson <phrosty_at_[hidden]> wrote:

>>ok results change when i use a larger object. clearly the list is faster
>>
>>Test build/remove 64
>>0.812
>>0.531
>>Test build/remove 256
>>8.688
>>2.016
>>Test build/remove 1024
>>126.487
>>11.032
>>
>>the object i used:
>>
>>class SmallObject {
>>public:
>> SmallObject() {
>> v = 0;
>> s = "hello";
>> }
>> int v;
>> std::string s;
>>};
>>
>
>
> however, i only plan on using small datatypes. for anything large, i
> will use pointers or shared_ptr<T>
>
> so the results for the larger object is not very relevant to my needs

FWIW, if the objects are larger and so you would tend to use an
std::list<T>, boost::ptr_vector<T> or boost::ptr_deque<T> probably
performs better as long as the major application is not insertions
in the middle of the data structure.

Try it out:

http://www.boost.org/libs/ptr_container/doc/ptr_container.html

-Thorsten


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net