By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,435 Members | 1,479 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,435 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

May 29 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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
May 29 '07 #2

P: n/a
swathi <ax*****@gmail.comwrote 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.
May 29 '07 #3

P: n/a
Andre Kostur wrote:
swathi <ax*****@gmail.comwrote 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
May 29 '07 #4

P: n/a
On May 29, 11:14 am, swathi <axel...@gmail.comwrote:
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

May 30 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.