All of the following translation from MSDN, some use words may not be accurate, please understand. Interested in viewing English in the original text. If you feel useful, I will continue to write.
I am a very dish, the Chinese level is not high. If you don't understand where you don't understand, or technical needs to be discussed (I can't guarantee the translation of the translation.) Please come out, there will be an opportunity to correct. I hope everyone can improve together.
About the implementation program performance adjustment
VC only supports performance tests on both professional and enterprise versions, as for why do this, please refer to Microsoft's related articles (Visual C Editions).
Performance test related articles are as follows:
Prep
Profile
PLIST
Profiler Won't Merge Statistics from Two DiffERENT OPERATING SYSTEMS on The Same Computer
Profiler Will Not Profile Dlls That Are FREED, THEN RELOADED
Onboard System Memory Cache and Disk Caches May Affect Profile Times
Profiling Windows NT Services
Error Writing to .pdb file after line Profile Operation
PRB: PROFILER FATAL ERRORS PRF1012 and PRF1306
Prep
The PreP program executes twice during a normal performance test (PROFILING). For the first time, it reads the executable file (.exe) and then generates .PBI and .pbt files. Next, it reads the .pbt and .pbo files and generate a new .pbt file for the PLIST program. (Translator Note: PREP, PLIST and PROFILE can be executed from the command line, of course, can also perform PROFILE from the project via the VC IDE, three executable itself saved in the BIN directory of the VC).
grammar
Prep [Options] [ProgramName1] [ProgramName2 ... ProgramName8]] PROGRAMNAME8]
PREP reads the command line in order from left to right, so the rightmost command line parameters may override the left and zipper command line parameters. All parameters are not sensitive. However, you have to add (/) or (-) symbol before the option, and the parameters are separated by spaces.
parameter
description
Options
Refer to the parameter table below.
Programname1
The file name of the program (suffix .dbg, .exe, or .dll) of the program (suffix .dbg, .exe, or .dll) is mainly required to perform performance measurement. If you don't specify a compact name, Profile will think that the suffix is .exe. This parameter must be used when using pred for the first time. But the second time is not necessary.
Programname2 ... programname8
Other additional procedures for performance tests are performed. These parameters can only be specified when preP is performed.
The place where 'x' appears in the table below, indicating that the parameter is only available in the 'x'.
Optional parameters
Prep The first execution can specify from the command line or the VC's Ide's Profiler dialog, but the parameter can only be specified from the command line for the second time.
Option
I
Ii
Description
/ At
X
Collect the execution time and execution of the function, and the call relationship between the function. Please refer to a later / stack parameter.
/ CB
X
When using a function execution time statistics, you are allowed to calibrate the calibration of time error, which is the time error when you perform function time statistics during execution of performance statistics. The calibration time error is displayed in the default PLIST output (which does not include a table separator). / EXC
X
When performing performance test, do not test the specified module, or part of the module. For example / exc Test.cpp (9-18).
/ EXCALL
X
Performance tests are not performed on all modules (see the considerations later). This parameter is used with / INC.
/ FC
X
The performance test of the number of functions is required.
/ Ft
X
The performance test of the function execution time is required. This parameter causes PROFILER to generate information on the number of functions execution. This command line parameter is default.
/ Fv
X
A function to perform a function of performing a performance test.
/ Inc
X
Specifies the part that needs to perform performance tests (see the considerations later). This parameter is used with / Excall.
/ H [ELP]
X
X
A simple help information for parameters for preP.
/ IO filename
X
The output is merged into an existing .pbo (output of the Profile). You can merge 8.pbo files at the same time. The default file name is .pbo.
/ IT filename
X
The output is merged into an existing .pbt (output of Profile). You can merge 8 .pbt files at the same time. You can merge the .pbt files generated using different performance test methods. The default file suffix is. PBT.
/ LC
X
Choose a test of the number of executions, take a long time.
/ LV
X
Select a line to overwrite the test.
/ M FileName
X
The combination of three parameters of / IT, / IO, and / OT.
/ NOLOGO
X
X
Remove the version information of pred.
/ Oi FileName
X
Generate a .pbi file. The default extension is .PBI. If the / oi parameter is not specified, the output .pbt file is "executable program name .PBT".
/ Om
X
Generating a suffix name is _xe or _ll itself can perform executable files that can perform performance tests, can record the call time, calling time of the function, and call overwriting. If this option is not specified, the executable code will be saved in the .pbi file. This parameter will accelerate performance test.
/ OT FileName
X
X
Specifies the .pbt file to be output. The default file after the column is. PBT. If you do not specify / ot parameters, then the output .pbt file is "executable program name .pbt".
/ Sf function
X
Start performance test from the specified function. But the function name must respond to an entry point in the .map file.
/ Stack DPT
X
When the / AT parameter is used, you can set the depth (DPT) of the calling stack.
/?
X
X
A simple help information for parameters for preP.
Environment variable
Prep
Specify a default command line parameter.
If no pre-environment variable is specified, the default preP parameter is
/ Ft / oi filename / OT filename
The filename will be set to the value of the command line parameter programname1.
Precautions
Parameters / INC AND / EXC are specified separate library files (.lib), target files (.Obj), and source programs (.c, .cpp, or .cxx) files. The statistics for calling counting and call overwriting for individual procedures. You can specify the number of rows that specify the source program:
/ EXCALL / Inc Test.cpp (3-41, 50-67)
This example only performs the performance test of line 3 to 41 rows and 50 to 67 lines in the source file Test.cpp. Note that the number of rows does not include blank lines in the source file.
If you want to specify all rows in the source file, you can: / Excall / Inc Test.obj
Or the number of rows in the specified source file is 0, like this:
/ EXCALL / INC TEST.CPP (0-0)
The following example performs performance test from the 50th line of the source file until the end of the file:
/ EXCALL / INC TEST.CPP (50-0)
Profile
The Profile application performs performance testing of the executable, and generates a .pbo to save the result. When you generate the .PBI file with a PREP, you can use Profile to perform performance test.
grammar
Profile [options] programname [programargs]
PROFILE reads the command line in order from left to right, so the rightmost command line parameters may overwrite the left and zipper command line parameters. All parameters are not sensitive. However, you have to add (/) or (-) symbol before the option, and the parameters are separated by spaces.
If you don't specify .pbo file name in the command line, Profile will use the basic name of the .pbi file plus. PPBO extension. If you don't specify a .PBI or a .pbo file, Profile will use the base name of the application to add .PBI and .pbo extension.
parameter
description
Options
Refer to the optional parameters below.
Programname
Performable file names for performance tests. If you do not specify a compact name, the default is the file ending in .exe. Please refer to the precautions.
Programrgs
Optional parameters when performing applications. Please refer to the precautions.
Optional parameters
Option
Description
/ A
Additional non-direct error messages to an existing file. If the / E parameter is specified and / a parameter is not specified, this file will be overwritten. This parameter is only valid if the / e parameter is specified.
/ E filename
Send the PROFILER's error message to the file specified by the file name filename.
/ H [ELP]
Provide a simple help information about the parameters of Profile.
/ I filename
Specifies to read information from one .pbi file. This file must be generated when PREP is.
/ NOLOGO
Remove the profile version information.
/ O FileName
Generate a specified .pbo file. Use the preples .pbo files, or to create a .pbt file for use with plist.
/ X
Returns the exit code when performing performance test.
/?
Provide a simple help information about the parameters of Profile.
Precautions
You must specify the file name of the executable executable of performance test in the profile command line. If you do not specify an extension, Profile will assume that the extension is .exe.
You can add the command line parameters of the executable after the file name.
If you are performing performance testing of code in a dynamic link library (.dll), the executable file (.exe) name of the dynamic link library is given. If you want to perform performance testing of Sample.dll, this dynamic library is called by Caller.exe, you can do this:
Profile Caller.exe
Suppose Caller.PBI has selected Sample.dll to perform performance testing. To know details, please refer to "Profile Dynamic-Link Libraries).
Environment variable
Profile
Specifies the default command line parameters.
If the environment variable of the Profile is not specified, there is no default optional parameter.