A program you wrote is not running as fast as you wish on yo
A program you wrote is not running as fast as you wish on your intended computer. Re-writing your code is one tactic to gain speed, but you want to try a faster-to-implement approach first. Your plan is to turn on some of the numerous optimization types available in the compiler you are using. You have done some research and recognize that the best speedup may require testing a variety of combinations of optimizations, so you have written a script to automate the compiles and timing of test runs. This software framework is aimed at improving what factor(s) in the CPU Time equation and how are they improved?
Solution
For example if I am need to of compling the C++ program and if need to increase the speed of compalition. Then the below mentioned points can be taken into accout.
1. Garud ConditionsThese Gaurd conditions we will use it keep our Header files that are not used more than one time in our translation system.
# pragma once // using the header file only once
#ifdef filename_h // defiining the IF condition
#define filename_h // defining the finle anemof the header
// Header declarations and definitions
# end if // end of the if condition
Above is the usahe of the plain macro solution and optimization of the compilation speed.
REDCUTION OF THE INTERDEPENDENCY:
-- Less interdependent and more odular code design is followed generally.
PRECOMPLIED OF HEADERS
-- Here we have carefully include the precomplied stuff (mean to say rarely changing stuff) , else it may lead to re work of the complete program.
Also, Cacche is the another technique it helps in speeding up.
USAGE PARALLELISM
We can opt for MP OPTION doe the paralellism in the FILE level, instead of going to the paralellism in the Project level
Uage of Shared of the Libraries, by which we are moving the less frequently modified code into the libraries , it can reduce the compilation time.
More RAM, Faster hard drives and more number of CPU\'s increases the compilation time for the program..
