Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Speed up Window creation in Linux
Forum Update on Monday, May 27th 2025

Speed up Window creation in Linux

Scheduled Pinned Locked Moved Unsolved General and Desktop
17 Posts 6 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vellis
    wrote on last edited by
    #1

    Is there a way of speeding up window creation in Linux? Any compilation flags that I can tweak to optimize my application for X11? Is it possible to enable XCB-only?

    I don't care about Mac/Windows, so, is there anything I can disable?

    jsulmJ 1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by Kent-Dorfman
      #2

      Why is this necessary? I've never experienced an X app in linux where the window creation is slow...but then I use a real man's window manager; none of this bloated wissy-whig crap that comes in Gnome. I use nothing more bloated than fvwm or twm on my systems. the other question is what is your graphical hardware and whos drivers are you using?

      1 Reply Last reply
      0
      • V vellis

        Is there a way of speeding up window creation in Linux? Any compilation flags that I can tweak to optimize my application for X11? Is it possible to enable XCB-only?

        I don't care about Mac/Windows, so, is there anything I can disable?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @vellis How long does it take now?
        If you have performance issues in your app are you sure it is not your app but X11/Qt?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vellis
          wrote on last edited by
          #4

          Booting up QT app rendering a single label and using QTimer::singleShot(0) to quit as soon as it starts:

          real 0m0.182s
          user 0m0.147s
          sys 0m0.021s

          Booting up XCB app rendering single label and using XCB_EXPOSE to quit as soon as it renders:

          real 0m0.019s
          user 0m0.005s
          sys 0m0.013s

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            This is a completely useless comparison since it for sure take longer to load all Qt libs and create a QApplication than a simple xcb app.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vellis
              wrote on last edited by
              #6

              Yes, of course! And that's precisely what my question is about: what can be enabled/disabled so I can fine tune the boot process to fit my needs.

              Kent-DorfmanK Christian EhrlicherC 2 Replies Last reply
              0
              • V vellis

                Yes, of course! And that's precisely what my question is about: what can be enabled/disabled so I can fine tune the boot process to fit my needs.

                Kent-DorfmanK Offline
                Kent-DorfmanK Offline
                Kent-Dorfman
                wrote on last edited by Kent-Dorfman
                #7

                @vellis said in Speed up Window creation in Linux:

                Yes, of course! And that's precisely what my question is about: what can be enabled/disabled so I can fine tune the boot process to fit my needs.

                The boot process has absolutely nothing to do with the Qt framework. It is specific to your environment and depends heavily on how your machine is configured. It is well outside of the pervue of the forum to analyze and diagnose linux bootup issues.

                FYI: bootup is the starting of the system from the point the kernel loads until it is ready to interact with the user. application startup is the time it takes to start the application once the command has been entered. Please use the correct terminology to lessen confusion.

                1 Reply Last reply
                0
                • V vellis

                  Yes, of course! And that's precisely what my question is about: what can be enabled/disabled so I can fine tune the boot process to fit my needs.

                  Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @vellis said in Speed up Window creation in Linux:

                  what can be enabled/disabled

                  Don't use Qt if you can't wait 100ms for your application startup process...

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  1 Reply Last reply
                  0
                  • V Offline
                    V Offline
                    vellis
                    wrote on last edited by
                    #9

                    @Kent-Dorfman said in Speed up Window creation in Linux:

                    The boot process has absolutely nothing to do with the Qt framework. It is specific to your environment and depends heavily on how your machine is configured. It is well outside of the pervue of the forum to analyze and diagnose linux bootup issues.

                    Sorry for the misunderstanding: by boot I mean framework boot, not machine boot. What I'm referring to in this topic is exactly what @Christian-Ehrlicher said in the last post: It takes longer for Qt to load all it's libs. How can I disable that? How can I disable unnecessary libraries and parts of Qt that are not relevant to a Linux-only app? Or, what kind of tweaks are available to reduce the impact to the minimum?

                    @Christian-Ehrlicher said in Speed up Window creation in Linux:

                    Don't use Qt if you can't wait 100ms for your application startup process...

                    Well, I can understand where you are coming from and I respect that opinion. However, what I'm asking isn't very out of this world: for a specific use case that does not consider Windows or Mac, that does not consider Library X or QML or whatever, what can be done to speed up the framework? What can be removed and tweaked?

                    I highly doubt that Qt isn't flexible enough to allow developers to reduce it to its barebones, and I don't understand why my questions are being met with certain resistance.

                    JonBJ 1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Hi,

                      There's nothing non-Linux in a Linux Qt build.

                      If you want to reduce load size, then go with Qt Lite and enable only what your application is using. This will make the Qt libraries lighter to load.

                      See this article for an introduction to it.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      V 1 Reply Last reply
                      3
                      • V vellis

                        @Kent-Dorfman said in Speed up Window creation in Linux:

                        The boot process has absolutely nothing to do with the Qt framework. It is specific to your environment and depends heavily on how your machine is configured. It is well outside of the pervue of the forum to analyze and diagnose linux bootup issues.

                        Sorry for the misunderstanding: by boot I mean framework boot, not machine boot. What I'm referring to in this topic is exactly what @Christian-Ehrlicher said in the last post: It takes longer for Qt to load all it's libs. How can I disable that? How can I disable unnecessary libraries and parts of Qt that are not relevant to a Linux-only app? Or, what kind of tweaks are available to reduce the impact to the minimum?

                        @Christian-Ehrlicher said in Speed up Window creation in Linux:

                        Don't use Qt if you can't wait 100ms for your application startup process...

                        Well, I can understand where you are coming from and I respect that opinion. However, what I'm asking isn't very out of this world: for a specific use case that does not consider Windows or Mac, that does not consider Library X or QML or whatever, what can be done to speed up the framework? What can be removed and tweaked?

                        I highly doubt that Qt isn't flexible enough to allow developers to reduce it to its barebones, and I don't understand why my questions are being met with certain resistance.

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by JonB
                        #11

                        @vellis
                        May I ask a question: the example you quote is for starting up a program to show a label and then quit, and you're concerned about its timing. To me that implies you are intending to run lots & lots of times to just show a message, or something similar? Is that the sort of thing you intend?

                        1 Reply Last reply
                        0
                        • SGaistS SGaist

                          Hi,

                          There's nothing non-Linux in a Linux Qt build.

                          If you want to reduce load size, then go with Qt Lite and enable only what your application is using. This will make the Qt libraries lighter to load.

                          See this article for an introduction to it.

                          V Offline
                          V Offline
                          vellis
                          wrote on last edited by
                          #12

                          @SGaist said in Speed up Window creation in Linux:

                          Hi,

                          There's nothing non-Linux in a Linux Qt build.

                          If you want to reduce load size, then go with Qt Lite and enable only what your application is using. This will make the Qt libraries lighter to load.

                          See this article for an introduction to it.

                          Thank you for the link! Is there a way of building Qt lite and statically linking it to my application with CMake? Like, just add_external_project(qt_lite_folder)? Is that an intended use case?

                          jsulmJ 1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by SGaist
                            #13

                            AFAIK, no.

                            Qt Lite is a "complete" Qt build with a reduced feature set so you use in place of the one you are currently using for your project.

                            [edit: fixed phrasing SGaist]

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            1
                            • Kent-DorfmanK Offline
                              Kent-DorfmanK Offline
                              Kent-Dorfman
                              wrote on last edited by
                              #14

                              Dear OP.

                              Just out of curiosity what hardware are you running this on? Please don't tell me it's a raspberry PI and that you expect prompt response on that platform, cause you aint gonna get it.

                              Kind regards,
                              a curmudgeony old coot who hates PIs.

                              1 Reply Last reply
                              0
                              • Christian EhrlicherC Offline
                                Christian EhrlicherC Offline
                                Christian Ehrlicher
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                @vellis said in Speed up Window creation in Linux:

                                for a specific use case that does not consider Windows or Mac, that does not consider Library X or QML or whatever, what can be done to speed up the framework?

                                Now you're speaking from the general speed, not from a startup (and shutdown) time which happens only once a program is started / stopped which is more or less negligible (except you're starting the program thousands of times a day) which you're measuring - so my statement stays - your testcase and comparison is useless.

                                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                Visit the Qt Academy at https://academy.qt.io/catalog

                                1 Reply Last reply
                                0
                                • V vellis

                                  @SGaist said in Speed up Window creation in Linux:

                                  Hi,

                                  There's nothing non-Linux in a Linux Qt build.

                                  If you want to reduce load size, then go with Qt Lite and enable only what your application is using. This will make the Qt libraries lighter to load.

                                  See this article for an introduction to it.

                                  Thank you for the link! Is there a way of building Qt lite and statically linking it to my application with CMake? Like, just add_external_project(qt_lite_folder)? Is that an intended use case?

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  @vellis You could build Qt statically and use this static build for your app. Loading your statically linked app should be faster compared to dynamically linked version.

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  SGaistS 1 Reply Last reply
                                  2
                                  • jsulmJ jsulm

                                    @vellis You could build Qt statically and use this static build for your app. Loading your statically linked app should be faster compared to dynamically linked version.

                                    SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #17

                                    @jsulm said in Speed up Window creation in Linux:

                                    @vellis You could build Qt statically and use this static build for your app. Loading your statically linked app should be faster compared to dynamically linked version.

                                    Without forgetting the licensing implications if you are using the GPL/LGPL version of Qt.

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    1

                                    • Login

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • Users
                                    • Groups
                                    • Search
                                    • Get Qt Extensions
                                    • Unsolved