Sign in Join
Wiki copytemporary

LazProfiler: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## About
22
33LazProfiler is an IDE addon which adds a One-Click-Profiler to Lazarus.
44
55### Screenshot
66
77![](/wiki-images/8/88/LP01.png)\
8-\
8+
99![](/wiki-images/b/b0/LP01_2.png)
1010
1111### Download
1212
1313- It's available on [GitHub](https://github.com/PascalRiekenberg/LazProfiler).
1414
1515### System Requirements / Dependencies
1616
1717- FPC trunk (needs generics and additional PascalParser funktionality) or fixes_3_2
1818- Lazarus trunk (revision 60719 and above) or fixes_2_0
1919
2020### Installation
2121
2222Download from [here](https://github.com/PascalRiekenberg/LazProfiler/releases) and install manually.\
2323It depends on LCLExtension and EpikTimer.
2424
2525### Support page
2626
2727<http://forum.lazarus.freepascal.org/index.php/topic,38983.0.html>
2828
2929## Using LazProfiler
3030
3131### Start profiling
3232
3333- Open your project (if not done already)
3434- Activate Profiler:
3535 - Open Configuration:\
3636 ![](/wiki-images/2/2b/LP03.png)
3737 - Check "Activate LazProfiler":\
3838 ![](/wiki-images/7/7a/LP06.png)
3939- Choose "Profile" from Run menu:\
4040 ![](/wiki-images/5/59/LP02.png)
4141- Use your program
4242- Close your program
4343- study LazProfiler output:\
4444 ![](/wiki-images/8/88/LP01.png)
4545
4646### Show output
4747
4848- Choose "Profiler (Results and Configuration)" from View menu:\
4949 ![](/wiki-images/2/2b/LP03.png)
5050
5151### Cleanup profiler
5252
5353In case the instrumenting of the sources produce not compileable code you can reset the profiler and tidy things up by choosing\
5454"Cleanup Profiler and restore original files" from Run menu:\
5555![](/wiki-images/9/98/LP04.png)
5656
5757### Influencing profiling
5858
5959#### Hints in source code
6060
6161By default the profiling automatically starts. If you just want to profile some parts of your code you can surround it by two comments:\
6262
6363``` pascal
6464// start-profiler
6565code_to_profile;
6666// stop-profiler
6767```
6868
6969#### Disable instrumenting
7070
7171If you want to exclude procedures/functions/classes/units/packages from beeing instrumented,\
7272just uncheck the checkbox in front of the procedure/function/class/unit/package name\
7373in the profiler output window.\
7474![](/wiki-images/3/3a/LP05.png)\
7575
7676> **Note:** Packages are only visible if tree is sorted by package\
7777> Units are onyl visible if tree is sorted by package or unit.\
7878> Classes are only visible if tree is sorted by package, unit or class.
7979
8080## How does it work?
8181
8282When profiling is started the following steps are done:
8383
8484- project is build to test if project is okay
8585- all sources in the projects unit and include directories are backuped (except units below fpc and lazarus source directories)
8686- procedures and funtions in units are instrumented with special profiling code
8787- project is build with instrumented code
8888- instumented sources are deleted and backups are restored
8989- program is run with no debugger
9090- profiling result is shown when program ends
9191
9292## Known issues
9393
9494- Profiling does not pause counting at ShowModal, ShowMessage, ...
9595
9696## Version History
9797
9898- 0.1.0.0
9999 - Initial release
100100- 0.1.1.0
101101 - leaving sources instrumented if compile after instrumenting fails
102102- 0.1.2.0
103103 - checking if backup was successfully created before writing instrumented code to original file
104104- 0.1.3.0
105105 - renamed menu entries
106106 - include IncludePath. Patch by zamtmn.
107107 - minor refactoring
108108 - fixed recognition of declared record in procedure var section
109109 - fixed memory leaks
110110- 0.2.0.0
111111 - new Result-TreeView\
112112 \- group by Unit\
113113 \- group by Object
114114 - fixed include handling
115115 - last group and sort column and order is saved to settings file now
116116 - refactoring
117117- 0.2.1.0
118118 - fixed recursive directory scan
119119 - do not scan include path
120120 - ignore units belonging to packages
121121 - fixed memory leak
122122- 0.2.2.0
123123 - Update for Lazarus 2.0
124124- 0.3.0.0
125125 - profiling of packages (only if outside of Lazarus source directory)
126126 - renamed columns "Net" -\> "Σ Net", "Gross" -\> "Σ Gross"
127127 - new columns: "% Net", "% Gross", "Ø Net", "Ø Gross"
128128 - fixed parsing of operator functions
129129 - fixed parsing of "START-PROFILER" and "STOP-PROFILER" if inside un-instrumented procedure/function
130130 - Activation of LazProfiler (default is inactive)
131131
132132---
133133*From the Free Pascal wiki, page "LazProfiler", as it stood on 2019-10-10 after a change by PascalR, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
134134Category: Debugging
135135Category: Profiling

Back to history