Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > best methods to do C,C++ code optimization ?

Reply
Thread Tools

best methods to do C,C++ code optimization ?

 
 
swathi
Guest
Posts: n/a
 
      05-29-2007
What are the best methods to do C,C++ code optimization manually ?
I has gone though some links sill not satisfied.
Can any one send me best optimization links

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      05-29-2007
swathi wrote:
> What are the best methods to do C,C++ code optimization manually ?
> I has gone though some links sill not satisfied.
> Can any one send me best optimization links


Try "Efficient C++" book. The main thing to understand is that any
optimizations should be based on measuring and analyzing.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
 
 
 
Andre Kostur
Guest
Posts: n/a
 
      05-29-2007
swathi <(E-Mail Removed)> wrote in news:1180451684.020073.20780
@g37g2000prf.googlegroups.com:

> What are the best methods to do C,C++ code optimization manually ?
> I has gone though some links sill not satisfied.
> Can any one send me best optimization links
>
>


Measure, measure, measure. Use some sort of profiling tool to find out
where your code is _actually_ too slow. Then look at why that code would
be too slow and fix it. Usually by changing algorithms.
 
Reply With Quote
 
Victor Bazarov
Guest
Posts: n/a
 
      05-29-2007
Andre Kostur wrote:
> swathi <(E-Mail Removed)> wrote in news:1180451684.020073.20780
> @g37g2000prf.googlegroups.com:
>
>> What are the best methods to do C,C++ code optimization manually ?
>> I has gone though some links sill not satisfied.
>> Can any one send me best optimization links
>>
>>

>
> Measure, measure, measure. Use some sort of profiling tool to find
> out where your code is _actually_ too slow. Then look at why that
> code would be too slow and fix it. Usually by changing algorithms.


The usual spiel about what to do after you measure, is "prevent extra
work from being performed" and "cache everything you can" and "use
lookup tables everywhere". When none of those are possible (i.e. they
have all been already applied), rearrange your objects in memory to
reduce CPU cache misses and page faults. Oh, and one more is "do all
work when the user is not looking", i.e. in the "background". Good
luck!

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
EventHelix.com
Guest
Posts: n/a
 
      05-30-2007
On May 29, 11:14 am, swathi <(E-Mail Removed)> wrote:
> What are the best methods to do C,C++ code optimization manually ?
> I has gone though some links sill not satisfied.
> Can any one send me best optimization links


The following article describes C and C++ optimization techniques:

http://www.eventhelix.com/RealtimeMa...AndCPPCode.htm

--
EventStudio 4.0 - http://www.EventHelix.com/EventStudio
Model in Plain Text; Generate Sequence Diagrams in PDF/Word

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zero Optimization and Sign Optimization??? Ravikiran C Programming 22 11-24-2008 03:19 AM
Is there a way to find the class methods of a class, just like'methods' finds the instance methods? Kenneth McDonald Ruby 5 09-26-2008 03:09 PM
Compiler code optimization: see code below joshc C Programming 14 01-14-2005 01:02 AM
optimizing code: sort algorithm, random numbers etc. Best resources for optimization? PWalker C++ 3 12-15-2004 11:08 PM
Re: Code optimization... Pete Wright ASP .Net 2 07-06-2003 12:24 AM



Advertisments