C

Application performance

There could be several aspects that might affect your application's performance either negatively or positively. In the following sections, you will know how some of these aspects affect performance and ways to control them.

Selecting a framebuffer strategy

Qt Quick Ultralite supports both single and double buffering strategies, offering a choice of better performance over memory usage. The single buffer strategy uses less memory but may come with performance overhead, whereas the double buffer strategy uses more memory but offers better performance.

See Framebuffering strategies for more information.

Selecting a font engine

Qt Quick Ultralite provides two font engine options: Monotype Spark and Static font engines.

Monotype font engine

  • Better support for internationalized applications that use a wide range of characters.
  • Better support for languages that require text shaping to ensure correct layout.
  • Runtime support for text scaling, without compromising on performance and text quality.

Static font engine

  • Better support for applications that do not use complex text and has lower footprint.
  • Operates on static precomputed data, enabling very fast lookup operations.
  • Processes font at build time, resulting in no runtime overhead.

Refer to the Feature comparison table for detailed comparison between the two font engines.

Using the Benchmark mode

You can use the Benchmark mode in an application to measure some key performance metrics when the application is running.

You can collect the following metrics in Benchmark mode:

ParameterDescription
1Total framesTotal number of frames in the recording interval.
2Average FPSAverage frames per second value measured during the recording interval.
3Minimum FPSMinimum frames per second value captured during the recording.
4Maximum heap usageMaximum heap usage in bytes recorded since the application was started.
5Maximum stack usageMaximum stack usage in bytes recorded since the application was started.
6Average CPU loadCPU Load in percentage value averaged over the recording interval.

The Benchmark mode involves running the application for a specified time and displaying the results at the end of this interval.

The Benchmark mode uses the QulPerf QML type to start and stop recording of the performance metrics.

For more information, see the Qt Quick Ultralite Thermostat Demo and Qt Quick Ultralite Automotive Cluster Demo, which use the QulPerf type to gather metrics.

Using cache

You can enhance your application performance by caching images and text.

Image caching

Use the ImageFiles.MCU.resourceCachePolicy QmlProject property to choose a caching policy for image resources.

Note: You must set source file properties before adding image files to the application using the ImageFiles.files QmlProject property.

Font cache priming

Using a lot of text in your application will affect its startup time significantly. In such cases, you could improve the startup time by populating the font cache at build time.

Note: Cache priming is only supported by Monotype Spark font engine.

See Cache priming for more information.

Text caching

You can improve text rendering performance by enabling text cache for the Qt Quick Ultralite application. When enabling the text cache, pixel data for each text element is cached, reducing the number of calls to the drawing engine.

Refer to Text caching section which explains in detail about text caching feature and how to enable it.

Using hardware layers

On MCU platforms that support hardware layers, you can enhance the Qt Quick Ultralite application performance by using many framebuffers and blend these framebuffers together to display the final image. Using hardware layers reduces memory footprint and rendering time.

See Improving performance using hardware layers for more information about hardware layer usage.

Available under certain Qt licenses.
Find out more.