Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Improving the speed of a C program

Posted on 2002-04-18
4
Medium Priority
?
173 Views
Last Modified: 2010-04-15
Does anyone know a good site which covers improving the execution speed of a C program with register variables, inline functions and the like?

Rob
0
Comment
Question by:rd707
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:nebeker
ID: 6951365
Before you go off and start changing variable types (to use "register") and other small-fry type changes, I would suggest that you first profile your application, to find out where the bottlenecks really are.

An excellent (but expensive) tool for this is Quantify from Rational  (http://www.rational.com/products/pqc/index.jsp).

After running the profiler, it will show you the three most important things you need to know before you start optimizing a program:

 * which functions are called the most often
 * which functions are the slowest
 * where your program spends a majority of its CPU time

Once you have this information, you can start digging into the appropriate functions.  But just randomly inlining functions, or changing your variable prototypes aren't going to work...

As the saying goes, 20% of your code does 80% of the work -- so find that 20% before doing anything else.
0
 
LVL 12

Accepted Solution

by:
guidway earned 200 total points
ID: 6951895
0
 
LVL 4

Author Comment

by:rd707
ID: 6952853
Excellent - many thanks.

rd707
0
 
LVL 12

Expert Comment

by:guidway
ID: 6953704
Glad to be of help. Thanks for the grade!

guidway
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question