PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • This lesson will teach you the following concepts
  • Overview
  • Starting the performance profiler
  • Studying the result
Lesson 10.3. Performance profiler
This lesson will teach you the following concepts
  • Overview.
  • Starting the performance profiler.
  • Studying the result.

Estimated time: 15 mn
Previous LessonTable of contentsNext Lesson
Overview
The performance profiler (also called Profiler) is a tool used to check and optimize the execution time of the processes found in your site.
The principle is straightforward:
  • You run the test of your site.
  • During this test, the performance profiler keeps track of all actions performed and saves the execution times of each one of the processes run.
At the end of test, the performance profiler displays:
  • the 10 most time consuming operations,
  • the duration and the number of calls for all processes run.
The "WW_Optimization" project contains a specific page used to view the interesting results with the performance profiler.
Starting the performance profiler
The performance profiler can be started:
  • from the WEBDEV editor:
    In this case, the project is automatically run in test mode. You can use your application and start the processes of your choice.
    To go back to the WEBDEV editor, all you have to do is exit from your site.
    Then, the performance profiler displays the monitoring result. This result is saved in a WPF file.
  • from one of your WLanguage processes, with the following functions:
    ProfilerStartStarts "collecting data" for the performance profiler.
    ProfilerEndStops "collecting data" for the performance profiler.

    In this case, only the code found between ProfilerStart and ProfilerEnd is studied. The result is saved in a WPF file.
  • The first method will be used in our example. To start the performance profiler on the "WW_Optimization" project:
    1. In the ribbon, on the "Project" pane, in the "Audit and performances" group, expand "Analyze the performance" and select "Analyze the performance".

      Note

      The performance profiler can also be started from the project dashboard, via the "Performances" widget. You must:
      • enable the Widget if necessary (click the link "Click here to re-enable").
      • click the arrow and select "Analyze the performances".
    2. The project test is run.
    3. Click the "Test page of performance profiler" button.
    4. Click the "Process to analyze" button.
    5. Validate the information window and stop the project test. The report window of performance profiler is displayed.
Studying the result
  • Let's study the report window of performance profiler. The results are displayed in several tabs:
    • the "Summary" tab presents the ten longest processes.
    • the "Mapping" tab presents a graphical view of main processes.
    • the "Details" tab presents all processes run during the application test (from the slowest one to the fastest one).
    • the "Calls" tab is used to view the details of operations performed in a process.
  • Let's present these different tabs in our example.
    • The "Summary" tab presents the ten longest processes. In our example, you can see that the local procedure named "UpdateProductStock" takes more than 3 seconds to run (this time may change according to the power of your computer).
    • The "Mapping" tab is used to visually identify what took the longest time. In our case, it's a call to HTTPRequest:
    • The "Details" tab presents all processes run, from the slowest one to the fastest one.
      The following information is displayed for each process:
      • Function: Function, process or procedure run.
      • Total Time: Execution time of function.
      • Internal time: Execution time due to the engine.
      • Nb of calls: Number of calls made to the function (procedure or process).
      • Time 1 call: Execution time of a call to the function (procedure or process).
      • % Code: Percentage of time spent in the process of function or procedure (developer code that can be optimized).
      • Parent: Element that contains the process.
  • In our case, the "Details" tab indicates that the call to HTTPRequest is one of the elements taking the longest time.
    1. Select this line. We are going to check whether this slowdown is caused by a specific problem.
    2. Click the "Calls" button to display the details of calls to the UpdateProductStock procedure. Select the "HTTPRequest" line and click the "Code" button: the corresponding code line is displayed in the code editor.
    3. Close the performance profiler.
    4. The following code line is run:
      HTTPRequest("supplier-addr")
      The slowdown is caused by the fact that the address specified for HTTPRequest is not accessible.
  • Let's check the operating mode of application by optimizing this code:
    1. Replace the code line containing HTTPRequest by the following code line:
      // Checks the accessibility of supplier server
      HTTPRequest("www.google.com")
    2. Save the code (Ctrl + S).
  • We are now going to restart the performance profiler:
    1. On the "Project" pane, in the "Audit and performances" group, expand "Analyze the performances" and select "Analyze the performances".
    2. The project test is run.
    3. Click the "Test page of performance profiler" button.
    4. Click the "Process to analyze" button.
    5. Validate the information window and stop the project test. The report window of performance profiler is displayed.
    6. In the "Mapping" tab, HTTPRequest does not appear with the same importance.
  • Close the report window of performance profiler.
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 23
Comments
Click [Add] to post a comment