473,396 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
4 1742
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Antoon Pardon | last post by:
Well at least I find them missing. For the moment I frequently come across the following cases. 1) Two files, each with key-value pairs for the same dictionary. However it is an error if the...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
3
by: PWalker | last post by:
Hi, I have written code that I would like to optimize. I need to push it to the limit interms of speed as the accuracy of results are proportional to runtime. First off, would anyone know any...
5
by: Felix I. Wyss | last post by:
Good Afternoon, I recently noticed that some very simple methods of a template declared and used in a DLL library get inlined when used by the DLL itself, but not by other DLLs and EXEs. After...
15
by: Andrew Brampton | last post by:
Hi, This may sound a odd question, but I wanted to know how you return a list of data from a function. These are some of the ways I know how, and I was wondering which method you normally use....
24
by: Earl | last post by:
I have all of my data operations in a separate library, so I'm looking for what might be termed "best practices" on a return type from those classes. For example, let's say I send an update from...
20
by: Joe | last post by:
Is any one charting packing considered to be the "best"? We've used ChartFX but wasn't too happy about the way data had to be populated along with some other issues which slip my mind right now and...
8
by: per9000 | last post by:
Hi, I wanted to test to compile an application I build for .NET 2.0 in with the 1.1 C# compiler. I encountered difficulties since I had a List<myClass>. I found a list of what is new in .NET 2.0...
1
by: Zach | last post by:
I was reading about partial methods in the upcoming C# 3.0 with a friends and we were having a discussion about their usefulness. One on hand, they seem to be ok at providing a solution for...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.