Solved

Improving the speed of a C program

Posted on 2002-04-18
4
164 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
  • 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 50 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
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…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now