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@geometricglobal.com

Geometric Limited
T +91.22.67056539    F +91.22.67056891    M +91.9833143936
www.geometricglobal.com