Which container I should choose for better performance?

Discussion in 'C++' started by davihigh@gmail.com, Dec 23, 2005.

  1. Guest

    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, 2005
    #1
    1. Advertising

  2. 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.
    Maxim Yegorushkin, Dec 23, 2005
    #2
    1. Advertising

  3. Ferdi Smit Guest

    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_index/doc/advanced_topics.html)

    --
    Regards,

    Ferdi Smit (M.Sc.)
    Email:
    Room: C0.07 Phone: 4229
    INS3 Visualization and 3D Interfaces
    CWI Amsterdam, The Netherlands
    Ferdi Smit, Dec 23, 2005
    #3
  4. Guest

    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, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JKop
    Replies:
    3
    Views:
    321
    Default User
    Apr 28, 2004
  2. devNorway
    Replies:
    5
    Views:
    333
    Mark Jones
    Dec 18, 2006
  3. Replies:
    0
    Views:
    279
  4. Replies:
    3
    Views:
    355
    RedGrittyBrick
    Mar 20, 2008
  5. Jayden Shui
    Replies:
    5
    Views:
    222
    Juha Nieminen
    Dec 21, 2011
Loading...

Share This Page