Need help in chosing a suitable Container

P

pc

Hi,
Currently we are using a CDwordArray type array to store some
DWORD data. This data is dynamic and we need to continuously grow
the array size using SetAtGrow() . Due to performance reasons, we
are planning to try out other possible choices (Cmap,Clist,STL.....).
We want to use the Container that has
the best performance in terms of insertion & random access. We
would like to know the STL Container Class that would suit this
scenario.

thanks & regards,
Sumanth
 
K

Karl Heinz Buchegger

pc said:
Hi,
Currently we are using a CDwordArray type array to store some
DWORD data. This data is dynamic and we need to continuously grow
the array size using SetAtGrow() . Due to performance reasons, we
are planning to try out other possible choices (Cmap,Clist,STL.....).
We want to use the Container that has
the best performance in terms of insertion & random access. We
would like to know the STL Container Class that would suit this
scenario.

The STL replacement for MFCs CxxxArray is called std::vector.
It provides very similar functionality.
 
A

Allan Bruce

Karl Heinz Buchegger said:
The STL replacement for MFCs CxxxArray is called std::vector.
It provides very similar functionality.

If you want good performance for both insertion and random access then
consider using a hashtable, they have a little overhead in generating a hash
code but otherwise have very good performance for random access and
insertion. The only other stipulation is that the generated hashcodes must
be unique.

Allan
 

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,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top