Which container I should choose for better performance?

D

davihigh

Hi Friends:

I am managing a large number of objects which has unique id <ULONG64>.
Which container i should choose to perform best find() performance?

Can choose from STL in vc2003 or Boost 1_33. Currently I am using
std::map<>. Your suggestion?

Rgds, David Xiao
 
M

Maxim Yegorushkin

Hi Friends:

I am managing a large number of objects which has unique id <ULONG64>.
Which container i should choose to perform best find() performance?

Can choose from STL in vc2003 or Boost 1_33. Currently I am using
std::map<>. Your suggestion?

You are likely to get faster lookup using hash tables rather than
trees. Profile the alternatives to see if that's the case for you.

Also hash tables tend to use less memory than trees.
 
F

Ferdi Smit

Hi Friends:

I am managing a large number of objects which has unique id <ULONG64>.
Which container i should choose to perform best find() performance?

Can choose from STL in vc2003 or Boost 1_33. Currently I am using
std::map<>. Your suggestion?

Rgds, David Xiao

I'd go for a hashed Boost.MultiIndex
(http://www.boost.org/libs/multi_index/doc/advanced_topics.html)

--
Regards,

Ferdi Smit (M.Sc.)
Email: (e-mail address removed)
Room: C0.07 Phone: 4229
INS3 Visualization and 3D Interfaces
CWI Amsterdam, The Netherlands
 
D

davihigh

Thanks a lot, folks.

MultiIndex is exactly what I need, it provide every facility i need.
Hopw it have a graceful performance while managing pretty large number
of objects. (around 100,000 -- 1,000,000 records)

Rgds, David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top