Awesome
Profile Viewer
Author: David Hoyle
Version: 1.0
Date: 29 Apr 2018
Web Page: http://www.davidghoyle.co.uk/WordPress/?page_id=1087
Overview
The purpose of this application is to provide the ability to view the instrumentation profiling information generated by the Profiler.pas
module which is contained in the project.
Please note that although this code is a more up to date version that on the web page above no functional changes have been added (the About Dlg and Check for Updates has been removed), the code has simply been updated for Git.
Use
The first part of using thos code is to include the Profiler.pas
file in a project and add the instrumentation to your methods. Examples are in the code for this project (calls to CodeProfiler.Start
and .Stop
at the start and end of your methods). You then need to add the compiler define PROFILECODE
to your project to enable the profiling (it is recommended to wrap the instrumentation in an IFDEF
with PROFILECODE
so you can switch off the profiling without having to remove the instrumentation).
Note: Instrumentation can be added to your code using Browse And Doc It or your can create a surround code template to achieve the same.
When you run your application the profiling information will be retrieved and when you exit the application it will be written to a diskfile named after your application with the .profile
extension.
You can the open this file with the profile viewer to see where the time is being spent. The profile viewer displays the information in a tree view that is determined by the execution paths in the code and it aggregates multiple calls to the same function. The list at the bottom will show an aggregated view of all the functions called below the selected tree node.