How to do it...

Follow these steps to start profiling and optimizing a QML application:

  1. Let's create a Qt Quick Application - Empty project:

  1. Then, go to Analyze | QML Profiler and run the QML Profiler tool:

  1. Your Qt Quick project will then be ran by the QML Profiler. The QML Profiler window will also appear under the code editor. Click the Stop button located at the top bar of the QML Profiler window after the program is passed your test point, which in this case, successfully created the empty window:

  1. After you stop the profiler analysis, a timeline will be displayed on the Timeline tab under the QML Profiler window. There are three tabs that you can switch between, namely Timeline, Flame Graph, and Statistics. You can switch between the different tabs at the bottom of the QML Profiler window:

  1. Let's check out the timeline tab. We can see five different categories under the timeline display: Scene Graph, Memory Usage, Compiling, Creating, and Binding. These categories give us an overview of the different stages and processes of our program throughout its execution. We can also see that there are some colorful bars being displayed on the timeline. Let's click on one of the bars under the Creating category that says QtQuick.Window/Window. Once clicked, we will be able to see the total duration for this operation and the location of the code displayed on the rectangular window, which is located at the top of the QML Profiler window:

  1. Once you are done with that, let's move on and open up the Flame Graph tab instead. Under the Flame Graph tab, you will see the visualization of the total time, memory, and allocation of your application in the form of percentages. You can switch between total time, memory, and allocation by clicking on the selection box that's located at the top-right corner of the QML Profiler window:

  1. Not only that, you will also see the percentage value displayed on your QML code editor:

  1. Open up the Statistic category under the QML Profiler window. This tab is basically showing us information about the processes in table form:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset