[Next] [Previous] [Up] [Top]
2 Building Your Program
2.6 Gathering and Applying Profile Information
Vortex can exploit dynamic profile information to generate highly-optimized code, ranging from 50% to 500% faster than without profile data. In order to reap the benefits of this optimization, profile information must be gathered and then exploited. Gathering profile information involves the following steps:
- Build an instrumented executable. This requires a full phase two re-compilation. It does not require a phase one(Vortex) re-compilation. You can build an instrumented executable by typing make pic or pm -pic at the Unix shell prompt in your gen directory.[2] If the program is named foo.cecil then the instrumented executable is named foo.pic. An instrumented executable is typically 10-50% slower than a normal executable.
- Run the instrumented executable to gather profile information. The most important aspect of this step is running the program on a representative input set. The program should be started with the --picstats command line option.[3] Profile data is dumped to standard output when the program terminates. Generally, you want to redirect the output of the program into a file. For example, you could gather profile information for the Vortex compiler using the following command:
% compiler.pic --picstats "optimize; make towers.tst" > c.pic
- A more sophisticated example is ${VORTEX_HOME}/Cecil/bin/shell/make_profile, the script which gathers profile data for Vortex itself.
- Process the profile output into the proper form. Several perl scripts in ${VORTEX_HOME}/bin/shell do this processing. The most useful form of profile data is n-CCP (call-chain profile data) which can be produced in the following manner (assuming ${VORTEX_HOME}/bin/shell is in your path):
% call-chain.perl < c.pic > c.nCCP
After profile data has been gathered, exploiting it is fairly easy. A file containing processed profile data can be read into Vortex by using the load_profile
command, e.g., Cecil> load_profile
c.nCCP. Once profile data has been read in, it is automatically exploited during optimizing compilations. Profile data is saved in the program checkpoint, so it can be utilized across many compilation sessions without having to be read in each time. It also is reasonably robust in the face of small program changes, so profile data from an older version of the program can continue to be used for modified versions of the program.
[2] To get these and other utility programs for manipulating profiling information into your path, you should source the ${VORTEX_HOME}/bin/shell/vortex.cshrc file in your ~/.cshrc.
[3] Command line arguments that start with --
are interpreted by the Cecil runtime system and are not passed on to the user program. They may appear anywhere on the command line. Passing --help
as a command line argument to a Vortex-compiled executable will cause it to list the recognized run-time system command line arguments.
How to Use the Vortex Compiler and Environments - 25 MARCH 1997
[Next] [Previous] [Up] [Top]
Generated with Harlequin WebMaker