Advanced PowerBuilder

HomePrevious Lesson: Collecting Trace Data - An Easy Way
Next Lesson: Class View

Performance Analysis - An Easy Way

Version 6.x Enterprise PowerBuilder edition comes with a 'Profiler' application along with the source code. You can use the source code for learning about how to use the tracing & profiling objects and methods, however, don't do any changes, since they are not supported by Powersoft. However, v7.0 changed this app and built this into PowerBuilder itself. If you don't see 'Profiling � ' icons under the Tools tab page when you select File/New menu option, that means you don't have it installed on your machine or your copy of PowerBuilder is not an enterprise edition.

The Profiler has three views, Class view, Routine View and Trace View. Let's start with the Class View. To start the Profiler tool, select File/New menu option and double click on 'Profiler Class View' icon located under Tools tab page.

When you open it for the first time, PowerBuilder prompts you for the trace file and later on it uses that file by default. Specify the file you provided in the 'System Options' dialog box. If you don't see any error that means the file is opened successfully. Set your preferences in the 'Preferences' dialog box (as shown in the picture) by selecting 'Options/Preferences' menu option.

The tracing and profiling APIs & objects depend on the your application's executable file and your application's PowerBuilder libraries. For example, to display the line numbers and the source code in the analysis, it needs to read your .PBL, your source code is not stored in the tracing file. Let's see what will happen if you rename product.pbl to new_product.pbl and launch profiler application? You will get the error as shown below:

Actually, the error is not explanatory at all. To coninue, make sure you close the 'Profiler xxxxx view' tool and rename the PowerBuilder library back to product.pbl.
HomePrevious Lesson: Collecting Trace Data - An Easy Way
Next Lesson: Class View