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

Need help in chosing a suitable Container

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

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
pc wrote:

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.

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 23 '05 #2

P: n/a

"Karl Heinz Buchegger" <kb******@gascad.at> wrote in message
news:42***************@gascad.at...
pc wrote:

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.


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
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.