using dynamic arrays in windows 98?

  • Thread starter Thread starter Aaron Lee
  • Start date Start date
A

Aaron Lee

I have written a program that uses quite a few different
dynamic arrays, such as the CArray class. I've noticed
that the compiled code runs quite well on Windows 2K and
XP platforms but it's really adding a ridiculous amount of
time when it's run on windows 98 machines. Before adding
these new code segments, the old program ran slow on the
98 platform. But now it's taking about 3 times longer
than before, while there is a negligable performance hit
on the 2K and XP platforms. Is there a reason for this?
Is there a way to improve this? I tried searching this
newsgroup for similar postings, I apologize if this
subject has already been covered.

Thanks for any information.
 
Hi Aaron,

Win9x platforms have *very* slow memory allocation managers compared with NT
onwards. My guess it that you are using the CArray's in a way that triggers
frequent resizing and thus calls for memory. Try using using SetSize in
anticipation of multiple Add's if your code permits. If this is not the
problem then perhaps you should look at anything else in your code that
might trigger frequent memory allocation.

Cheers

Doug Forster
 
Back
Top