LSPS documentation logo
LSPS Documentation
Profiling

Profiling serves to identify possible performance problems in the execution of expressions, such as, function calls, assignment, multi-instance calls, etc.

The following profiling features are available:

  • Profiler that gathers a list of function and closure calls with execution longer than 1 ms.

The execution duration is counted cumulatively: when a function call takes longer than 1 ms in a node of the model instance tree, the call is included in the list (any function calls from the body of this function are considered part of the main function call).

  • Trace Logger prints data about invocations with execution longer than a defined period in milliseconds into the Log view and log file. This feature can be of use in environments, where LSPS Profiler cannot be used. Also, it might be more convenient as input for analysis in other systems.

Profiling with LSPS Profiler

To profile with LSPS Profiler, do the following:

  1. Enable profiling by running your server with the property -DlspsProfile=true.

    For your Embedded server, you can do so as follows:

    1. Stop the Embedded server.
    2. Go to Runtime Connections -> Runtime Connection Settings
    3. In the Preferences dialog under Process Design Suite -> Management -> Runtime Connections edit the LSPS Embedded Server connection.
      embeddedwithprofilerproperty.png
      Profiler-enabling property on the Embedded Server connection setting
  2. In the Management perspective, open the Profiler view.
  3. Run the models you want to profile.

    Note that if other users are running models on the server, their model instances are be included in the results.

  4. Refresh the Profiler view to display the profiling results: click the calls to display it in the Module if this is available in the Workspace.
profilingview.png
Profiler view with results
Note that the list with the function statistics contains the most recent function calls. To display the most expensive function calls of the profiling sessions, click the Expensive Operations button in the view toolbar.

To import and export profiling results in the XML format, click the export button or the import button in the Profiler view respectively.

Profiling with Trace Logger

To profile with LSPS Trace Logger, do the following:

  1. Enable profiling by running your server with the property:
    -Dcom.whitestein.lsps.lang.InterpreterStackTraceFactory=com.whitestein.lsps.lang.TimerInterpreterStackTraceFactory
    You can set also the threshold execution time (by default 5ms) with the property -Dcom.whitestein.lsps.lang.TimerInterpreterStackTrace.threshold; for example, set it to 100ms with -Dcom.whitestein.lsps.lang.TimerInterpreterStackTrace.threshold=100
  2. Run the models you want to profile.

The log file for the PDS Embedded Server is by default located in <WORKSPACE>/.LSPSEmbedded/wildfly-<VERSION>/standalone/log/

Note that if other users are running model instances on the target server, their model instances will be included in the results.