By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,928 Members | 1,200 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,928 IT Pros & Developers. It's quick & easy.

Which container I should choose for better performance?

P: n/a
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

Dec 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

da******@gmail.com wrote:
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.

Dec 23 '05 #2

P: n/a
da******@gmail.com wrote:
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_inde...ed_topics.html)

--
Regards,

Ferdi Smit (M.Sc.)
Email: Fe********@cwi.nl
Room: C0.07 Phone: 4229
INS3 Visualization and 3D Interfaces
CWI Amsterdam, The Netherlands
Dec 23 '05 #3

P: n/a
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

Dec 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.