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. Does compiling Qt works for improving the Application's performance
Qt 6.11 is out! See what's new in the release blog

Does compiling Qt works for improving the Application's performance

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 5 Posters 1.3k Views 3 Watching
  • 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.
  • DonationD Offline
    DonationD Offline
    Donation
    wrote on last edited by Donation
    #1

    We just finished our program, and now the thing is that the RAM usage is a little high. We have tried some effective ways to solve it, but we still want to optimize.
    So we decide to compile Qt by ourselves(qt-everywhere-src-5.14.0) through using configure command line, such as -no-feature-udpsocket, or -skip to configure, and then compiling it. The result is, the program package is lessened indeed, but it makes no difference with the RAM usage. So I want to know whether this way works for improving the application's performance(RAM or CPU usage).
    Thanks for your help.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Recomping Qt should not make a dramatic effect on ram usage as
      most of that comes from the actual app.
      Stripping features might make the support DLLS smaller but
      will not affect the performance of the remaining.

      So i would analyze the app and figure out what the ram usage is and see if something can be done there.

      DonationD 1 Reply Last reply
      2
      • mrjjM mrjj

        Hi
        Recomping Qt should not make a dramatic effect on ram usage as
        most of that comes from the actual app.
        Stripping features might make the support DLLS smaller but
        will not affect the performance of the remaining.

        So i would analyze the app and figure out what the ram usage is and see if something can be done there.

        DonationD Offline
        DonationD Offline
        Donation
        wrote on last edited by
        #3

        @mrjj Thanks for your reply. Making support DLLS smaller is also a good thing for us. I would try another way to improve that.
        Here is another question if you don't mind. Do you have any suggestions about renaming the DLLS? For example, when I finish compiling, I hope the Qt5Core.dll could be renamed to MyCore.dll. Or does it work if I combine these DLLS, such as compiling Qt5Core.dll and Qt5Widgets.dll in one dll.
        As far as I know, I can't find a way to do this. I'm expecting for your reply.

        mrjjM jsulmJ 2 Replies Last reply
        0
        • DonationD Donation

          @mrjj Thanks for your reply. Making support DLLS smaller is also a good thing for us. I would try another way to improve that.
          Here is another question if you don't mind. Do you have any suggestions about renaming the DLLS? For example, when I finish compiling, I hope the Qt5Core.dll could be renamed to MyCore.dll. Or does it work if I combine these DLLS, such as compiling Qt5Core.dll and Qt5Widgets.dll in one dll.
          As far as I know, I can't find a way to do this. I'm expecting for your reply.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Donation
          Hi
          It would be complicated to rename or merge the dlls as
          the whole module system is built around those names.
          and tools like qmake links automatically to Qt5Core so
          having it uses other names might require lots of code changes.

          Why do you want to rename them?

          DonationD 1 Reply Last reply
          0
          • DonationD Donation

            @mrjj Thanks for your reply. Making support DLLS smaller is also a good thing for us. I would try another way to improve that.
            Here is another question if you don't mind. Do you have any suggestions about renaming the DLLS? For example, when I finish compiling, I hope the Qt5Core.dll could be renamed to MyCore.dll. Or does it work if I combine these DLLS, such as compiling Qt5Core.dll and Qt5Widgets.dll in one dll.
            As far as I know, I can't find a way to do this. I'm expecting for your reply.

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

            @Donation Actually, you should first find out what exactly consumes RAM in your app before hacking around with Qt. You could use Valgrind for example. Most probably it is not Qt eating the RAM/CPU.

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

            DonationD 1 Reply Last reply
            3
            • jsulmJ jsulm

              @Donation Actually, you should first find out what exactly consumes RAM in your app before hacking around with Qt. You could use Valgrind for example. Most probably it is not Qt eating the RAM/CPU.

              DonationD Offline
              DonationD Offline
              Donation
              wrote on last edited by Donation
              #6

              @jsulm Thanks for your reply, I'm already do something to improve before. And the performance is good. I just want to know if it's useful to make my app better.

              1 Reply Last reply
              0
              • mrjjM mrjj

                @Donation
                Hi
                It would be complicated to rename or merge the dlls as
                the whole module system is built around those names.
                and tools like qmake links automatically to Qt5Core so
                having it uses other names might require lots of code changes.

                Why do you want to rename them?

                DonationD Offline
                DonationD Offline
                Donation
                wrote on last edited by
                #7

                @mrjj It seems like a stupid idea, haha.
                My friends discussed with me about the renaming, so I also wonder if it can be done.

                mrjjM 1 Reply Last reply
                0
                • DonationD Donation

                  @mrjj It seems like a stupid idea, haha.
                  My friends discussed with me about the renaming, so I also wonder if it can be done.

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Donation
                  Well technically it should be possible but the benefit is hard to see :)
                  It would be like digging a hole for a swimming pool with a spoon.
                  Its possible but really not recommended.

                  DonationD 1 Reply Last reply
                  1
                  • sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on last edited by
                    #9

                    If you want more performance, use higher optimization flags (-O3 or link time optimisation). If you want smaller size, use -Os. You can't have both ;-) Maybe except one solution (if your license permits): static. With statick Qt and application, your linker will remove all unnecessary code when linking, and compiler will speed things up when optimizing.

                    (Z(:^

                    DonationD 1 Reply Last reply
                    3
                    • sierdzioS sierdzio

                      If you want more performance, use higher optimization flags (-O3 or link time optimisation). If you want smaller size, use -Os. You can't have both ;-) Maybe except one solution (if your license permits): static. With statick Qt and application, your linker will remove all unnecessary code when linking, and compiler will speed things up when optimizing.

                      DonationD Offline
                      DonationD Offline
                      Donation
                      wrote on last edited by
                      #10

                      @sierdzio Thanks for your help and I will try it.

                      1 Reply Last reply
                      0
                      • mrjjM mrjj

                        @Donation
                        Well technically it should be possible but the benefit is hard to see :)
                        It would be like digging a hole for a swimming pool with a spoon.
                        Its possible but really not recommended.

                        DonationD Offline
                        DonationD Offline
                        Donation
                        wrote on last edited by
                        #11

                        @mrjj ok, i will leave out this idea
                        Thank you again for your help

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SimonSchroeder
                          wrote on last edited by
                          #12

                          I also would've suggesting static linking with Qt. As @sierdzio mentioned you need to make sure to comply with the license. If you have a commercial license it don't think it is a problem (I have never had a closer look at the commercial license). If you only use your software inhouse and don't distribute it there is also no problem when using LGPL. If your software is open source then I also don't see a problem. If, however, you use Qt under LGPL and distribute your software then you need to provide every user with a way to relink your software with their own Qt version (it does not make much sense if some of it is inlined, but that is the law). Basically, you would need to provide upon request (at least) the object files of your software or your whole software packed into a library together with instructions how to link it with Qt.

                          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