Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Boot time optimization techniques



  • I'm working on a project with QT and Linux on imx6 target. My requirement needs the Linux and application to be up and running in less than 5 seconds. Currently my QT application itself takes around 5 seconds to start and show the initial screen excluding the linux up time.

    I have done the following and have questions on the same.

    • Loaders - I'm using Loaders to break the QML loading in a sequence so that I get the necessary content loaded in advance. Is there any other alternative to loader?
    • Static Linking - Does static linking help in reducing boot time? Currently I'm using all dynamically linked QT libraries which on a whole consumes about 20MB.
    • Resources: I have optimized all the images in my project. Does building the resources out of my application help in this? Currently I'm building the application and resources as one single exe.

    What more can I do to make the QT application to load faster? Any tips would be helpful.
    Thanks.


  • Moderators

    Hi @Srinivasan, have a read through the posts at https://blog.qt.io/blog/category/boot-time/ (especially the "Fast-Booting Qt Devices" series)



  • Some things should be done for a Fastboot, for example:

    1. If you can use Commercial version and qtquickcompiler and static compilation better
    2. File System on Linux, test according to your hardware and remove support from what you will not use
    3. Using eMMC for example is "faster" than boot via microSD / SD
    4. Remove unnecessary resources or used during debugging of the Linux Kernel
    5. Remove unnecessary resources or used during bootloader development
    6. It depends on the hardware but test and validate the use of: MTD with UbiFS, use initramFS and some other alternatives
    7. Boot system there are some, but usually systemd if you get a better job for getting parallelism to start the services
    8. In the Qt application too, as images to be loaded use asynchronous loading, use "Lazy Load" for the first screen that would be SplashScreen

    There is a general job to do, but if you get the boot you want.

    Links that may help:
    http://blog.qt.io/blog/2016/04/20/fast-booting-qt-devices-part-1-automotive-instrument-cluster/
    http://blog.qt.io/blog/2016/04/27/fast-booting-qt-devices-part-2-optimizing-qt-application/


    Cleiton Bueno

    Blog | Linkedin | B2Open



  • @Cleiton-Bueno Thanks for your inputs.

    • Currently working on the static compilation with commercial version.
    • initramFS is one thing which we have in mind moving forward.
    • Other than that, we have already taken care most of your listed points.

    And those links really helped. I have gone through them earlier.



  • @JKSH Yes I did.

    On QT part, we followed a lot of techniques mentioned in that post. Using Loaders for lazy loading, optimizing images, using qtquickcompiler. The major challenge is on the OS boot time that we are working on.