For C++, we will be using the Visual Studio built-in Performance Profiler tool.
Note that you need an executable file to proceed with this profiling step. Make sure to run the application at least once before proceeding to the next steps!
To profile your code, follow the below steps:
- Make sure to enable the benchmark test case in test/BenchmarkTest.cpp
- Go to
Debug
>Performance Profiler...
- Click on the
Change Target
drop-down button, and chooseExecutable
- Make sure the
Performance Wizard
checkbox is checked - Click on the
Start
button. This should open the windowPerformance Wizard
- Choose the
CPU Sampling
option then clickNext
- Choose the
An executable (.EXE file)
option then clickNext
- From
What is the full path to the executable?
, select the .exe file associated with this kata. It should be under cpp/build/bin/Debug. - Click
Next
- Make sure the box
Launch profiling after the wizard finishes
is checked - Click on
Finish
- Once the report is finalized, you can go to the
Call Tree
view to analyze the time consumed by each function. - Improve your code and redo steps 1 to 8
- Make sure to enable the benchmark test case in test/BenchmarkTest.cpp
- Go to
Debug
>Performance Profiler...
- Click on the
Change Target
drop-down button, and chooseExecutable
- From
Path to the executable?
, select the .exe file associated with this kata. It should be under cpp/build/bin/Debug. - Click
OK
- Select
CPU Usage
- Click on
Start
button - Once the report is finalized, you can set
Current View
dropdown toFunctions
- Improve your code and redo steps 1 to 8