How to Find Slow Code and Bottlenecks in your PowerBuilder App?

Visual Expert offers a dedicated macro under Performance Analysis - Slowest Code (Tree) to find objects with the longest execution time, slowing down your PowerBuilder application.

With Visual Expert, you can choose the scope for performance analysis from an entire application to one library, methods, objects and so on.

Find the Slowest Code in an Entire PowerBuilder Application

  • Select the root of the PBL in the Main View.
    This will include all the libraries present in your PB code.
    Select Root PBL in your App
  • In the Navigation Bar, go to Performance Analysis > Slowest Code (Tree)
    Slowest Code (Tree) macro
    Visual Expert will display the top 10 slowest methods - with the longest average execution time - in a container hierarchy.
    Top Slowest Objects in PowerBuilder App
  • Click on the wrench icon to open the macro options.
    Slowest Code Macro Options
    A new macro parameter window will open, wherein you can change the size of the list.
  • Change the number of items displayed from 10 to 20 and click on [Execute]. VE will then display the top 20 slowest objects in the treeview.
    Modify Slowest Code Macro Options
  • You can also specify the minimum execution time for an item to be displayed in the result of this macro.
    For instance: 5 milliseconds, 7 milliseconds, 10 milliseconds and so on. Click on [Execute].
    Prioritize Minimum Execution Time Slowest Code
  • VE will then only display objects that exceed the specified limit.
    Display Objects Exceeding Minimum Limit

Find the Slowest Code in One Library

  • Select any one library from all the PBLs available in the application.
    Select a PBL for Performance Analysis
  • Go to Performance Analysis > Slowest Code (Tree). (Same as above)
    Visual Expert will display the top 10 slowest objects or methods in that particular PBL.
    Slowest Objects in a PBL

For One or More Specific Object(s)

  • Select one or more objects in the treeview.
    Select Objects in Slowest Code Result
  • Go to Performance Analysis > Slowest Code (Tree). (Same as above)
    Visual Expert will display the top slowest methods for each object selected in the list.
    Display Slowest Methods for Specific Objects

The Powerbuilder developers can review these results to work on the objects with the longest average execution time and remove bottlenecks.

See Also:

Visual Expert, PowerBuilder, Code Review, Code Metrics, Code Performance