473,472 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need help in chosing a suitable Container

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
2 1648
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael Klatt | last post by:
I need to design a container similar to a std::set, but where the stored objects may be modified via a non-const iterator. In some cases the modification will effect the sort order. Here's an...
7
by: William Payne | last post by:
Hello, have you seen a recent files menu in a GUI application? In many GUI applications there's a menu the displays the most recent files that has been opened by the program. Say such a menu has...
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
5
by: Darren Smith | last post by:
Hi There, I have a shopping cart app that displays products along with a textbox (to enter quantity) and an image button to add the item to the shopping cart. Please explain why my below...
4
by: Prasad | last post by:
Hi, What are the different considerations/guidelines in chosing raw device or file containers for DMS tablespaces? A link would be very helpful. Thanks, Prasad.
1
by: Doogie | last post by:
Hi, I have been trying to get a checkbox added to a repeater control of mine and then try to access events of the repeater control when a user clicks the checkbox. At first, since the control is...
6
by: StephQ | last post by:
I need to implement an algorithm that takes as input a container and write some output in another container. The containers involved are usually vectors, but I would like not to rule out the...
7
helpwithcode
by: helpwithcode | last post by:
Hi people, I am just learning java.I have been creating a project which involves JDBC Connectivity.I find that the statements, String string_dob=text_dob.getText(); //Converting string to...
20
by: d.s. | last post by:
I've got an app with two classes, and one class (InventoryInfoClass) is an object within the other class (InventoryItem). I'm running into problems with trying to access (get/set) a private...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.