all groups > visual c libraries > november 2003 >
You're in the

visual c libraries

group:

Performance of VC++ Data Structures


Performance of VC++ Data Structures Kelvin
11/11/2003 12:16:42 AM
visual c libraries:
to All,

I'm a newbie in VC++, can anyone tell me about the
performance in various Data Structures (eg. Enum, map,
list, vector, hash, arrayList)?

I would like to know performance on CPU and Memory Usage.

eg. Mem usage may involve the mem usage on
creating/deleting an element in the structure.

eg. CPU performance may involve the overhead in iterating
the structure (just estimation will do)

By the way, I'm not very familiar to their
advantages/disadvatntages too, so can anyone also tell me
about it?

Thanks!

from kusanagihk
Re: Performance of VC++ Data Structures Andy
11/13/2003 12:29:23 PM
I think that you really need to read a book!
If you are new to C++ and do not come from a C background I would strongly
recommend
"Accelerated C++" by Andrew Koenig and Barbara Moo.

As an aside if you are just learning - don't worry about performance. You
have enough on your plate in learning about C++.
If you focus on clean design and clear code performance *usually* takes care
of itself on modern hardware.
If having done your best shot at good clean design and coding and then find
there is an issue with performance then go back and look at your code and
think about ways of making it better.

Regarding choice of data structure. (map, list, vector etc). They have
been designed for slightly different applications. Whether they perform
well or not depends on how you use them. For example if you have a
collection that you want to do lots of inserts into the middle then a vector
is probably not going to perform well. If you need very fast access on a
reasonably static collection then a vector will perform very well indeed.
Before you can make these judgements you need to understand what the various
things were designed for and how they should be applied and the book
mentioned above is an excellent place to start. After you have read that
you might like to consider Josuttus book "The C++ standard library".
www.josuttis.com

Another resource that you might want to check out is ACCU. www.accu.org.
They produce two excellent journals that are very accessible to new comers.

HTH

[quoted text, click to view]

AddThis Social Bookmark Button