Difference between revisions of "LazProfiler"

From Free Pascal wiki
Jump to navigationJump to search
Line 20: Line 20:
  
 
=== Support page ===
 
=== Support page ===
needs to be set up
+
http://forum.lazarus.freepascal.org/index.php/topic,38983.0.html
  
 
== Using LazProfiler ==
 
== Using LazProfiler ==

Revision as of 05:39, 18 November 2017

About

LazProfiler is an IDE addon which adds a One-Click-Profiler to Lazarus.

Screenshot

LP01.png

Download

System Requirements / Dependencies

  • FPC trunk (needs generics and additional PascalParser funktionality)
  • Lazarus trunk (revision 56254 and above)

Installation

or

  • Download from here and install manually.
    It depends on LCLExtension, EpikTimer and VirtualTreeView.

Support page

http://forum.lazarus.freepascal.org/index.php/topic,38983.0.html

Using LazProfiler

Start profiling

  • Open your project (if not done already)
  • Choose Profile from Run menu:
    LP02.png
  • Use your program
  • Close your program
  • study LazProfiler output:
    LP01.png

Show output

  • Choose Profiler from View menu:
    LP03.png

Cleanup profiler

In case the instrumenting of the sources produce not compileable code you can reset the profiler and tidy things up by choosing
Cleanup Profiler from Run menu:
LP04.png

Influencing profiling

Hints in source code

By default the profiling automatically starts. If you just want to profile some parts of your code you can surround it by two comments:

// start-profiler
code_to_profile;
// stop-profiler

Disable instrumenting

If you want to exclude procedures/functions from beeing instrumented,
just uncheck the checkbox in front of the procedure/function name
in the profiler output window.
LP05.png

How does it work

When profiling is started the following steps are done:

  • project is build to test if project is okay
  • all sources in the projects unit and include directories are backuped (except units below fpc and lazarus source directories)
  • procedures and funtions in units are instrumented with special profiling code
  • project is build with instrumented code
  • instumented sources are deleted and backups are restored
  • program is run with no debugger
  • profiling result is shown when program ends

Known issues

  • Profiling does not stop counting at ShowModal, ShowMessage, ...