Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Memory usage of a C++ program with CLASS and without CLASS

Status
Not open for further replies.

nsw1216

Member level 3
Joined
May 7, 2010
Messages
60
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,667
Hi all,

I developing a C++ Program to deal with huge data computation. I am using Pointers to hold the data during computation. Current program i developed without using CLASS.

I would like to ask that will the memory usage will be reduced and computational time will be shortened if I modified my program implementing the CLASS into it ?

Hope can get some suggestions to improve my program.

Thanks.
 

You will use more memory and generally get a slightly worse performance when you use classes.
Of course it highly depends on your specific implementation and difference might be from practically zero to quite a lot.
Unless you do some bad programming (use a lot of small classes, use often copying constructors etc.) performance should be basically equal and it's important to optimize the algorithm and specific code sequences which take most time.
 

Thanks for the explanations, MirekCz.

So, is there any suggestions that I can reduce the usage of memory during the computation process ?
 

I´m not totally sure, but I presume that using the inline statement could improve code size, and consequently could reduce dynamic memory usage.
 

Hi, Andre_teprom.

Thanks for your suggestion. But may I know any info I can refer regarding to the inline statement ?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top