Boost logo

Boost Users :

From: Carvalho, Malcolm (Malcolm.Carvalho_at_[hidden])
Date: 2008-08-22 01:35:31


 
Hi,
I need to use boost::unordered_set for inserting about 100000 elements
with a constant time efficiency for the insert function.
 
I checked the time taken for inserting 25,000 elements each time, and
found that it is as follows:
 
Time for inserting 1-25000 elements: 250
 
Time for inserting 25001-50000 elements: 250
 
Time for inserting 50001-75000 elements: 171
 
Time for inserting 75001-100000 elements: 297

I am using the std::pair<iterator, bool> boost::insert(const value_type&
obj) function. Please refer the attached project for details.
 
Is there any way to make this insertion time constant irrespective of
the number of elements already present in the set?
 
 
Regards,
 
Malcolm Carvalho
 
        Malcolm Carvalho
Senior Software Engineer, Mumbai Delivery Centre
malcolm.carvalho_at_[hidden]

Geometric Limited
T +91.22.67056539 F +91.22.67056891 M +91.9833143936
www.geometricglobal.com <http://www.geometricglobal.com/>

 
 
 
 
 
 





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