Click here to Skip to main content
15,914,780 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: RealTime Priority? Pin
Manikandan13-Oct-04 5:22
Manikandan13-Oct-04 5:22 
GeneralRe: RealTime Priority? Pin
Antony M Kancidrowski13-Oct-04 5:33
Antony M Kancidrowski13-Oct-04 5:33 
GeneralRe: RealTime Priority? Pin
Manikandan13-Oct-04 6:20
Manikandan13-Oct-04 6:20 
GeneralRe: RealTime Priority? Pin
Antony M Kancidrowski13-Oct-04 11:41
Antony M Kancidrowski13-Oct-04 11:41 
AnswerRe: RealTime Priority? Pin
geo_m13-Oct-04 21:42
geo_m13-Oct-04 21:42 
GeneralRe: RealTime Priority? Pin
Manikandan13-Oct-04 21:51
Manikandan13-Oct-04 21:51 
GeneralRe: RealTime Priority? Pin
geo_m14-Oct-04 0:28
geo_m14-Oct-04 0:28 
GeneralVectors vs Arrays Pin
mcsherry12-Oct-04 23:03
mcsherry12-Oct-04 23:03 
Hi all,

Apologies if this has already been covered but I could find it anywhere.

The problem that I have is that a piece of software that I am working on used a lot of arrays and matrices (i.e. float* and float**), the problem that we where having was that the program was leaking memory like there was no tomorrow (about a meg every 10secs) and the program was crashing at 'innocent' parts of the code.
After spending quite a while trying to solve these errors I decided to go at it with a sledge hammer and change all of the arrays and matrices to STL vectors (i.e. vector for the arrays and a vector <vector> for the matrices). I've now finished making the changes and the program no longer leaks memory or crashes, however it now runs at about 50% slower. I've changed where the vectors are created so that they are only created once. This has improved things quite a lot however it is still noticibly slower about 10%, does anyone have any other easy optimisation methods that I can implement.

I've left the way that the program accesses the data the same using the [] and [][] brackets.

Any thoughts or suggestions will be gratefully received!
Andy
GeneralRe: Vectors vs Arrays Pin
V.12-Oct-04 23:37
professionalV.12-Oct-04 23:37 
GeneralRe: Vectors vs Arrays Pin
mcsherry12-Oct-04 23:47
mcsherry12-Oct-04 23:47 
GeneralRe: Vectors vs Arrays Pin
Mike Beckerleg13-Oct-04 0:05
Mike Beckerleg13-Oct-04 0:05 
GeneralRe: Vectors vs Arrays Pin
Kevin McFarlane13-Oct-04 6:36
Kevin McFarlane13-Oct-04 6:36 
GeneralRe: Vectors vs Arrays Pin
Maximilien13-Oct-04 0:56
Maximilien13-Oct-04 0:56 
GeneralRe: Vectors vs Arrays Pin
mcsherry13-Oct-04 2:40
mcsherry13-Oct-04 2:40 
GeneralRe: Vectors vs Arrays Pin
Kevin McFarlane13-Oct-04 6:37
Kevin McFarlane13-Oct-04 6:37 
QuestionCString += CString :: doesn't do the trick? Pin
V.12-Oct-04 22:39
professionalV.12-Oct-04 22:39 
AnswerRe: CString += CString :: doesn't do the trick? Pin
RChin12-Oct-04 23:21
RChin12-Oct-04 23:21 
GeneralRe: CString += CString :: doesn't do the trick? Pin
V.12-Oct-04 23:32
professionalV.12-Oct-04 23:32 
AnswerRe: CString += CString :: doesn't do the trick? Pin
David Crow13-Oct-04 3:39
David Crow13-Oct-04 3:39 
GeneralRe: CString += CString :: doesn't do the trick? Pin
V.13-Oct-04 4:39
professionalV.13-Oct-04 4:39 
AnswerRe: CString += CString :: doesn't do the trick? Pin
Phil J Pearson14-Oct-04 5:15
Phil J Pearson14-Oct-04 5:15 
Generalthread safe lazy singleton intialization Pin
peterchen12-Oct-04 22:09
peterchen12-Oct-04 22:09 
GeneralRe: thread safe lazy singleton intialization Pin
Joaquín M López Muñoz13-Oct-04 0:19
Joaquín M López Muñoz13-Oct-04 0:19 
GeneralRe: thread safe lazy singleton intialization Pin
peterchen13-Oct-04 1:52
peterchen13-Oct-04 1:52 
GeneralRe: thread safe lazy singleton intialization Pin
Neville Franks13-Oct-04 0:30
Neville Franks13-Oct-04 0:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.